WASHINGTON — A federal judge refused on Tuesday to halt a lawsuit by congressional Democrats alleging that President Trump has illegally profited from his business while in office, and ordered evidence gathering to begin on Friday.

The Justice Department said it would appeal the ruling by Judge Emmet G. Sullivan of United States District Court for the District of Columbia. Many legal experts predict that the extraordinary contest over whether Mr. Trump has violated the so-called emoluments clauses of the Constitution will eventually reach the Supreme Court.

The president’s lawyers had asked Judge Sullivan to delay the lawsuit, which was filed by nearly 200 congressional Democrats, while they appealed his earlier rulings to the United States Court of Appeals for the District of Columbia Circuit. But in a 12-page opinion, Judge Sullivan said the president had failed to meet the high standard required to put aside the usual procedure of appealing a judicial decision at the end of a case.