GREENBELT, Md. — A closely watched lawsuit claiming that President Trump is violating the Constitution by failing to divorce himself from his businesses appeared to inch forward on Thursday during a lengthy hearing before a federal judge in Maryland.

Judge Peter J. Messitte voiced skepticism about the Justice Department’s arguments that he should dismiss the lawsuit, filed last year by the District of Columbia and the State of Maryland, on the grounds that Mr. Trump’s continued ownership of his businesses was a political issue, not a legal one.

Although the president’s lawyers persuaded Judge George B. Daniels of the United States District Court in Manhattan to throw out a similar lawsuit last month, Judge Messitte made clear that he was not bound by that ruling.

“Don’t cite Judge Daniels to me,” he admonished the Justice Department lawyer at one point.

Judge Messitte also suggested that the Justice Department was demanding too much proof too early of claims by the District of Columbia and Maryland governments that they had sustained monetary losses because Mr. Trump had failed to give up his ownership of hotels and other businesses. “You are asking for very specific losses,” he said.