PETERSBURG, N.D. — Before Senator Heidi Heitkamp spoke to constituents in this tiny rural town, population 175, Mary Ann Dunbar confessed that she had reservations about Judge Brett M. Kavanaugh, President Trump’s nominee to the Supreme Court.

But Ms. Dunbar, a 67-year-old social worker, was not about to press her Democratic senator to take a stand against the judge, as she fretted that a vote against a Trump nominee could jeopardize Ms. Heitkamp’s already difficult bid for a second Senate term in a state where the president is popular. It wouldn’t be worth it.

“I think you have to be realistic,” she said. “He’s probably going to win anyway, and if it makes the people of North Dakota happy, then I’d rather have her there.”

As Senate Democrats try to hold their ground in midterm elections in which they are defending a daunting list of seats, Ms. Heitkamp is a prime example of why the party’s fight against Judge Kavanaugh faces almost impossible odds.