If it appears that two or more persons have, or would have had if the legal ballots cast or intended to be cast for them had been counted, the highest and an equal number of votes for the same office, the persons receiving such votes shall decide by lot, in such manner as the court shall direct, which of them shall be declared duly elected; and the judgment shall be entered accordingly.
10 ILCS 5/23-27