In a major setback to the legislative investigation into the George Washington Bridge lane closings scandal, a New Jersey judge ruled on Wednesday that two of Gov. Chris Christie’s former aides do not have to comply with subpoenas seeking emails and other communications about the closings and attempts to cover them up.

In the ruling, Judge Mary C. Jacobson of State Superior Court in Mercer County criticized the subpoenas as “a fishing expedition” by the State Legislature, controlled by Democrats, which is investigating why Mr. Christie’s allies closed two access lanes at the bridge in September — and what the governor, a Republican, knew.

Judge Jacobson agreed with lawyers for the two aides, Bridget Anne Kelly and Bill Stepien, saying the subpoenas “clearly violate” federal and state protections against self-incrimination and unlawful search and seizure. She disagreed with lawyers for the legislative panel who had argued that Ms. Kelly and Mr. Stepien were required, as public employees, to turn over their records.

“The fundamental problem with the subpoenas is that they are overbroad,” she wrote.

Judge Jacobson left open the possibility that the Legislature could compel the aides to testify by offering them immunity from prosecution. But that could significantly tie the hands of the United States attorney who is conducting a separate inquiry into the closings and allegations that emerged in the wake of the scandal — about misuse of Hurricane Sandy funds and the politicization of the Port Authority of New York and New Jersey, which runs the bridge.