Wybrali ją na burmistrza.

English Translation

They elected her to be the mayor.

since we are talking about a “her” in this sentence, could or should the answer be “Wybrali ją na burmistrzynię”, using the accusative case of the feminine version of burmistrz?

I’d say both options are correct here, and it’s a matter of preference. “Burmistrz” is the name of the position, and many Poles would consider it to be the preferred option even if we’re talking about a female.

As of 2023, there is no such a word burmistrzynia in any dictionary https://sjp.pl/burmistrzynia

That would make sense, because the correct form is burmistrzyni: burmistrzyni - Słownik SJP.