A Bronx judge hinted strongly today that it may be necessary to sue the Federal Bureau of Investigation and the Justice Department in federal court so Bronx prosecutors can proceed with the criminal charges against Labor Secretary Raymond J. Donovan.

Bronx Supreme Court Justice John P. Collins made the suggestion at a hearing this morning on federal officials' refusal to provide the FBI witnesses and documents needed to resolve a dispute over the primary evidence in the case.

The dispute involves FBI tape recordings compiled during a 1979 surveillance of one of Donovan's co-defendants, reputed organized-crime member William P. Masselli.

Masselli's lawyer contends that the tapes were obtained by "blatantly lawless" tactics on the part of FBI agents and the U.S. Attorney's office in New York. Bronx prosecutors say the tapes are not tainted, but since last summer they have not been able to interview the agents or obtain the documents that would settle the argument.

The result, at today's hearing, was an unusual joint attack by chief Bronx prosecutor Stephen R. Bookin and Masselli's lawyer, John Nicholas Iannuzzi, on the FBI and the Justice Department.

Bookin said the Justice Department, which has just completed an internal inquiry into Iannuzzi's charges of misconduct, informed Bookin Wednesday that he could now "read" the approximately 50 interviews of government officials conducted in recent weeks as part of the probe. But Bookin said this small concession came without assurance that he could even speak to those interviewed, much less call them as witnesses.

Bookin said "we disagree vehemently" with the Justice Department's position. Iannuzzi, meanwhile, charged that the FBI is trying to "flaunt sic the jurisdiction of this sovereign state, perhaps to save themselves embarrassment."

"There's no excuse for officials responsible for the enforcement of the law to come into this court and say, . . . 'Maybe we'll let the agents come in to testify and maybe we won't,' " Iannuzzi protested.

At the heart of the matter is Iannuzzi's contention that the government lied about the identity of an FBI informer, Michael Orlando, in seeking federal court approvals of the Masselli surveillance, and that the FBI covered up crimes by Orlando in order to pursue Masselli and political figures with whom Masselli did business.

Judge Collins said his powers as a state judge were plainly "limited." He said Bookin might get the "quickest results" by subpoenaing the FBI agents and documents in question and then filing a federal suit to enforce the subpoenas. The judge gave Bookin until Feb. 19 to decide.

Bookin, meanwhile, filed a 159-page memo assailing defense motions to dismiss the indictment. He accused defense lawyers of "specious contentions" about the prosecution's conduct and said there was substantial evidence of a "deliberate, well-contrived scheme" to defraud the New York City Transit Authority of millions of dollars on a $186 million subway project. Donovan, who is on leave from his post, is charged with fraud and grand larceny in connection with the alleged scheme.

Bookin assailed the defense argument that successful prosecution would harm the government's minority business programs, which Masselli allegedly exploited along with Donovan's construction company. Dismissal of the indictment, Bookin argued, would simply "condone the manner in which the minority business program was abused."