So far, Judge Messitte has ruled against Mr. Trump at every step. But the case is still in its early stages, and the Justice Department signaled on Friday that it would seek emergency relief from a higher court rather than comply with his latest order.

“This case, which should have been dismissed, presents important questions that warrant immediate appellate review,” said Kelly Laco, a department spokeswoman.

If necessary, the president’s lawyers will ask the Supreme Court to intervene, predicted Josh Blackman, a constitutional law professor at the South Texas College of Law in Houston.

“It’s a really big deal,” he said of the plaintiff’s goal. “They want to depose the president and get his records. There are a lot of legal questions to resolve before you get there.”

The attorneys general for Maryland and the District of Columbia contend that the Trump hotel unfairly competes with convention centers and hotels in their jurisdictions. Among other documents, they are expected to seek records that reveal the identity of hotel guests who visited the White House on official business, as well as how much the president has profited. Ultimately, they could try to go after the president’s tax returns.