With all 140 legislative seats in the state up for election, Virginia Democrats retained their majority in the state Senate and flipped the House of Delegates in Tuesday’s elections, fending off an almost-certain attempt by Republicans to roll back the state’s ambitious climate act.