His corner of Pennsylvania coal country was “an ocean of Trump signs in 2016”, Democratic activist Ben Bright said.

Today, all across the staunchly Republican area, there are Democratic yard signs backing Conor Lamb, a young ex-marine who is fighting for a seat in Congress.

The special election in Pennsylvania’s 18th district has become an important test of Donald Trump’s political potency. He won overwhelmingly here in 2016, in a district that includes Republican-leaning Pittsburgh suburbs and vast swaths of coal country that were ancestrally Democratic.

When he ran, Republican congressman Tim Murphy faced only token opposition. However, in October 2017 Murphy was forced to step down after it was revealed that he urged a woman with whom he was conducting an extramarital affair to have an abortion.

His resignation set up a special election in which Democrats are running a candidate who is considered formidable while Republicans have chosen one considered weak.

Lamb is 33, an ex-marine and federal prosecutor with the good looks and earnest demeanor of a student council president. His opponent, Rick Saccone, is a 60-year-old state legislator with an arch-conservative record and the type of broad, close-trimmed mustache that went out of style some time shortly after the end of the second world war.

Saccone has billed himself as “Trump before Trump”. However, in a blue-collar and heavily pro-union district that is as concerned about workers’ rights as the second amendment, his conservative voting record on labor issues has led to unions unanimously endorsing the Democrat. Before the sex scandal, Murphy was consistently endorsed by unions.

A sign in Waynesburg, Pennsylvania, backing Republican candidate Rick Saccone, the 60-year-old state legislator with an arch-conservative record. Photograph: Maranie Staab/Reuters

In interviews with the Guardian, both candidates were cautious on how they would deal with gun control demands following the Florida high school shooting. They equivocated on whether they would support increasing the minimum age to buy an AR-15 semi-automatic rifle. Lamb wanted to focus on “fixing the background check system” while Saccone hedged, saying he was “willing to listen to both sides and engage in that debate”. In a televised debate with Lamb on Saturday, the Republican came out against an increase in the age limit.

As a legislator, Saccone was the sponsor of a bill to allow gun owners to freely carry a concealed firearm without a permit.

The two men are in an election race brought about by a sex scandal, but both declined to weigh in on the many allegations of sexual misconduct and assault against Donald Trump.

“As far as I know, the president denies that and I haven’t heard anything from the voters in the 18th district about that,” said Saccone. “I’m focused on taxes and spending issues that people in the district have told you about.”

Lamb said: “I’m not running against the president. In this entire campaign, you guys love to ask about him but that’s not what my voters want.”

Anti-Trump sentiment, however, is clearly a factor behind the enthusiasm for Lamb. Speaking to the Guardian at a Lamb fundraiser, former Maryland governor Martin O’Malley compared the grassroots energy in the Democratic party to “green shoots after a forest fire”.

One of those shoots was the Washington County Democrats, a grassroots group set up a year ago, different from the formal county Democratic party in an area pockmarked with blue-collar industrial towns. Two leaders, Ben Bright of Slovan and Christina Proctor of Canonsburg, said the new group had started to run monthly meetings and was actively volunteering for Lamb.

Many members had not been involved before Trump’s election and talked about the spark of enthusiasm that they saw. Bright noted that Lamb had “yard signs in yards” all over the district while Saccone’s campaign only seemed to put signs in the right of way on the side of the road.

Yard signs showing support for congressional candidate Conor Lamb in Bethel Park, Pennsylvania. Photograph: Maranie Staab/Reuters

Yet for all the proliferation of signs, the race will come down to voters. Outside a Whole Foods in Upper St Clair, a prosperous, traditionally Republican suburb of Pittsburgh, shoppers overwhelmingly preferred the Democrat. Linda Ortenzo told the Guardian “we need someone young and fresh” in Washington and talked about the need to “clean house”. There were exceptions, like Victor Raj of South Fayette, who thought Trump “was doing a good job” and was backing Saccone.

The question is whether the district’s instinctive conservatism will overcome the surge in Democratic intensity. Both Democratic and Republican observers consider the race a toss-up.

Outside Republican groups have invested millions of dollars, trying to counterbalance Saccone’s lackluster fundraising and what one Republican operative conceded was an “underwhelming” campaign.

But while Lamb has been a strong fundraiser, raising more than $3m with 70,000 individual contributions in the last fundraising period, outside groups on the left have been far stingier.

Whatever happens in the 13 March vote, the 18th district will not exist in November when every House seat is up for grabs in the midterms.

The Pennsylvania supreme court ruled in February that the state’s congressional districts were unconstitutional, producing a new map that erased the 18th. If Lamb wins he will face a different Republican in a redrawn suburban swing district in November.

For Democrats, even a narrow loss would be a moral victory, leaving Lamb with a developed brand, poised to win a new race in November. For Republicans, a Democratic victory in the Trump heartland would be a major blow ahead of the midterms, after losing a Senate race in deep red Alabama in December.

For all of Saccone’s flaws, he is not Roy Moore, the Republican whose Alabama campaign was marred by sexual assault claims. In order to win, Democrats have to build a fragile coalition of their own energized base, suburban Republicans disaffected with Trump and blue-collar voters disaffected with everything.

Chuck Nimal, a union truck driver from Canonsburg, Pennsylvania, showed up to support Lamb at a labor rally last week in front of the Washington county courthouse.

About two dozen other union members rallied to express support for public sector unions as the supreme court heard a case that could potentially cripple them. They were addressed by Lamb and several union activists on a handheld megaphone that projected the speeches over quiet rumbles of trucks and loud roars of motorcycles driving by.

Afterwards, Nimal, a lifelong Democrat, thought his neighbors in an area that overwhelmingly voted against both Ronald Reagan and Barack Obama, might support Lamb. They just have to be “tired enough of being tired”, he said.