A moderate Republican’s savaging by voters shows why Democrats think they can take back Congress