Democrats consolidated their power in the state legislature and will act as a counterweight to Gov. Glenn Youngkin’s policy agenda.