Elections are usually the exclusive province of living people. Typically, certain requirements must be met before someone can run for office, such as a minimum age or living in the area one wishes to govern. Having a pulse kind of goes without saying.
But none of that has stopped dead people from defeating their living contenders, sometimes by significant margins, to win seats they will never occupy. Voters were usually aware that the candidate they were voting for was dead, but they still went out to vote for them. In all instances, the deceased winners died before their elections, but their names remained on the ballots for legal reasons.