A  Superior Court judge on Wednesday dismissed a lawsuit  seeking to end a longstanding police policy that prohibits officers from initiating contact with people for the sole purpose of learning their immigration status.