LOGAN, W.Va. — Richard Ojeda presented himself as a new face of the Democratic Party: a tough guy in combat boots whose economic populism was the key to flipping coal country and maybe — just maybe — a model for winning in rural America in the age of Donald J. Trump.

For a moment, Mr. Ojeda seemed poised to pull it off. He channeled West Virginia’s union roots when he championed a statewide teachers’ strike earlier this year. He had a plain-speaking, almost Trump-like style that attracted attention and money, drawing more than $2 million in donations from around the country.

But on Tuesday he lost badly, taking just two out of the 18 counties that make up the Third Congressional District, a swath in the southern coal fields that is home to Mr. Ojeda and many of the teachers he supported. He even lost his home county, Logan, by 24 points.

“I was absolutely slapped in the face when I saw the totals,” said Heather Ritter, a school librarian and supporter of Mr. Ojeda, the day after the election.