WASHINGTON — The Justice Department has come under increasing pressure in its investigation of the former deputy F.B.I. director Andrew G. McCabe, as a federal judge threatened to release internal department records unless prosecutors decide whether to move forward with or abandon the politically charged case.

Judge Reggie B. Walton of Federal District Court for the District of Columbia, who is presiding over a lawsuit over F.B.I. documents related to Mr. McCabe’s firing last year, said at a hearing on Monday that he would soon begin releasing them. The Justice Department has argued that the materials should stay confidential while prosecutors investigate Mr. McCabe over whether he lied to internal investigators about dealings with the news media.

“You all have got to cut and make your decision,” Mr. Walton said, according to a transcript. “It’s not a hard decision, and I think it needs to be made. If it’s not made, I’m going to start ordering the release of information because I think our society, our public, does have a right to know what’s going on.”

Mr. McCabe, long a target of President Trump’s, was the subject of a scathing report by the Justice Department inspector general’s office that faulted him for violating media policy and repeatedly misleading its investigators. They were asking about an October 2016 Wall Street Journal article about an investigation into the Clinton Foundation. Mr. McCabe, working through the F.B.I. press office, had authorized a spokesman and a bureau lawyer to speak to a reporter to rebut allegations that he had slowed the inquiry.