HYDE PARK, N.Y. — The Democrats thought they had the most devastating weapon: a political video showing the Republican incumbent hugging a young mother with a brain tumor and a spinal condition, and promising to protect her coverage of pre-existing conditions — only to vote for the Republican bill to repeal Obamacare weeks later.

The Republicans, in turn, believed they had the most devastating piece of political tape: the Democratic challenger rapping a decade ago, using expletives and a racial epithet common among black rap artists, as he veered into controversial topics.

The question: Which clip will prove more politically potent in America in 2018?

The race — in a swing district a couple of hours north of New York City that, just like the nation, voted twice for President Barack Obama and then swung to President Trump in 2016 — has become one of the most expensive of 2018.

It is a battle, in miniature, of the same fault lines and forces buffeting the midterms across the country, with Democrats blitzing Republicans on health care and Republicans trying to rally their base by leveraging sometimes inflammatory cultural issues. The Republican, Representative John Faso, is white; the Democrat, Antonio Delgado, is black.