The party swept statewide elections in admittedly blue states and saw signs of a rebuke of President Donald Trump and a resurgence for Democrats after a year in the political wilderness.