WASHINGTON — A judge on Monday dismissed a high-profile lawsuit by a former national security aide to President Trump who had asked a court to clarify whether he should obey a subpoena from Congress to testify in the impeachment inquiry, or defy it on the White House’s instructions.

In a 14-page opinion, Judge Richard J. Leon, of the United States District Court for the District of Columbia, ruled that the lawsuit by the former presidential aide, Charles M. Kupperman, was moot because House Democrats had subsequently dropped the attempt to subpoena him.

“The House clearly has no intention of pursuing Kupperman, and his claims are thus moot,” Judge Leon wrote.

The lawsuit by Mr. Kupperman, a former deputy national security adviser to Mr. Trump, had been closely watched because it was seen as a harbinger for whether his former boss, John R. Bolton, might testify about what he knows about Mr. Trump’s use of his official powers to pressure Ukraine into announcing investigations that could benefit him politically.