Republicans’ primary intervention strategy propelled them to a majority, but they failed to flip four battlegrounds that Donald Trump carried.