WASHINGTON — A federal district judge in Washington ruled on Tuesday that congressional Democrats could proceed with a lawsuit claiming that President Trump was violating the Constitution by continuing to profit from his businesses while president.

The decision by Judge Emmet G. Sullivan of the United States District Court for the District of Columbia is at least a temporary victory for the president’s critics who assert that he is willfully flouting constitutional bans meant to restrict the ability of any federal official to accept financial benefits from foreign governments.

But the Justice Department is likely to quickly appeal the ruling on the so-called emoluments clauses. The department’s lawyers have already appealed a similar decision by another federal judge in Maryland. A three-judge panel from the Fourth Circuit Court of Appeals in Richmond, Va., is expected to rule on that appeal soon, probably in the president’s favor.

A second appeal of Tuesday’s decision, this time to the less conservative Court of Appeals for the District of Columbia, would place the same issue before two appellate panels. But the Justice Department has little choice but to appeal Judge Sullivan’s ruling because plaintiffs in that case will otherwise be able to begin gathering evidence about Mr. Trump’s corporate finances.