If they follow through in filing the suits, Democrats will be effectively calling on a third branch of government, the federal judiciary, to settle a dispute between the legislative and executive branches over Congress’s right to conduct investigations and the extent of the president’s authority to shield evidence from lawmakers. The answer could have significant implications not just for Mr. Trump, but for oversight of the executive branch for decades to come.

But there is no guarantee the courts will give them a useful outcome — at least not quickly. Past cases have stretched on for months or even years, a fact that could become problematic for Ms. Pelosi and her team as they seek to keep calls for impeachment at bay.

It was not immediately clear how quickly Democrats would file a suit against Mr. McGahn, a key figure in Mr. Mueller’s report, or if they would seek court enforcement against Mr. Barr at all. The Judiciary Committee chairman, Representative Jerrold Nadler of New York, told reporters on Tuesday that the House would not dawdle but that timing would depend on the House general counsel who represents lawmakers in court. The counsel, Doug Letter, will address Democrats on Wednesday morning in a closed meeting.

“We’re not going to go to court with the attorney general so long as in good faith they do what they have agreed to do,” Mr. Nadler said after the vote.

Tuesday’s resolution also gives Mr. Nadler the authority to petition a federal judge for access to secretive grand jury material amassed in the course of Mr. Mueller’s investigation. Such information rarely becomes public, but Mr. Nadler has made the case that his committee needs access to it to determine whether impeachment is warranted. His efforts to persuade the Justice Department to join him in making the request were rebuffed.

The dispute in the Oversight Committee could soon put to a test yet another provision of Tuesday’s resolution, allowing committees to go straight to court to enforce subpoenas without a full House vote as long as they have the blessing of leadership.

Wednesday’s contempt vote stems from an investigation into why the Trump administration is trying to add a question about citizenship to the census — which Democrats fear would suppress population counts in liberal-leaning areas ahead of reapportioning congressional seats.