Democrats have prevailed in Tuesday’s special elections to fill two vacancies in the Virginia General Assembly.