Virginia city’s preelection fight over certification shows how local procedures have become a flashpoint