Democrats flipped seats that had long been held by Republicans in a wave of historic leadership firsts.