Secretary of Labor Raymond J. Donovan said today he is still confident that the criminal charges against him would be dismissed quickly, but he said he has no intention of resigning even if the case lasts past winter.

"I think the president wants me to serve," Donovan told reporters outside the U.S. Courthouse here. "I certainly want to serve."

Currently on leave of absence from his Cabinet post, Donovan made the remarks at the conclusion of four days of hearings on his petition to have the charges against him transferred to federal court, away from what his attorneys describe as the "hostile" atmosphere of the Bronx court where he was indicted Sept. 24 by a state grand jury.

U.S. District Court Judge Lloyd F. MacMahon concluded the "removal" hearings this afternoon by asking pointed questions of both sides, and then announcing that he would take the case under advisement. He said he wants to study it carefully because it affects "the delicate relationships between state and federal governments," particularly in criminal investigations and prosecutions.

MacMahon asked that legal briefs be submitted over the holiday season from all sides, including the indicted executives of Donovan's firm, Schiavone Construction Co., who say they feel they can get a speedier trial in the Bronx and who do not want their case moved into federal court even if Donovan's is.

With a ruling now delayed until January, Donovan told reporters that it would be "an unfortunate thing" if the case takes another two months or so.

"I think it will take a shorter time than that, though," he said, expressing confidence that his attorneys can get the indictment dismissed without his having to go to trial. "I want to get back to the job. The president wants me back there."

At the hearing upstairs, Bronx prosecutors clashed sharply with Donovan's lawyers over the timing and propriety of the 137-count indictment against him, the first ever returned against a sitting U.S. Cabinet officer.

Donovan lawyer William O. Bittman charged that the secretary was the victim of "a setup, pure and simple," on Sept. 24, when he testified before a Bronx grand jury just hours before it voted to indict him.

The chief of the Bronx prosecution team, Stephen R. Bookin, replied that the grand jury would have voted on the indictment, with or without Donovan's voluntary testimony, because a crucial count was about to slip away under the five-year statute of limitations.

That count, Bookin said, involved an allegedly false billing for $800,000 in connection with equipment used by Schiavone Construction and an allegedly fraudulent minority firm working for Schiavone on a $186 million subway project here.

Bookin said the billing, dated Oct. 1, 1979, was backdated to March 1979, to within a week of Donovan's co-signing of a $200,000 check that permitted the subcontractor to begin adding workers to its payroll.

Bronx prosecutors have charged that the $200,000 interest-free advance to the subcontractor, Jopel Contracting, was part of a scheme in which Jopel would pretend to rent equipment from Schiavone, and Schiavone actually would use it and keep the payments for it while telling the New York Transit Authority that the money was being passed on to a minority business enterprise in accordance with state and federal regulations.

Bittman charged that "the single act" tying Donovan to the alleged conspiracy was the $200,000 advance, which was repaid in six months. Bittman also argued that even if Donovan did everything of which he was accused, he would still be entitled to a trial in federal court because Donovan would have been obliged, as a Cabinet officer, to report those crimes to federal authorities.

Bookin responded that that was the same as saying that if Donovan "committed state crimes, he also committed federal crimes." The Bronx prosecutor argued that this was not enough to justify moving the case into federal court.

In another dispute left for the judge to sort out, Bittman accused Bookin of taking out of context remarks by then-special prosecutor Leon Silverman before an April 23, 1982, federal grand jury investigating alleged ties between Donovan and members of organized crime.

Bookin denied taking Silverman's remarks out of context.