The example is a little silly, because people are unlikely to vote in that situation. Elect, in that sort of context, suggests that they were chosen through a vote.
However, the general point of electing people to do something is fine. Google Ngram Viewer shows a lot of "elected him to" phrases, and some of them have verbs as the next word. Of course, if it's electing someone to do a job, to fill a position, you see "elected him as" a lot, too. It's the fact of when people would vote that does a lot to determine what verb you might see after "elected him to".
Now, elect can be a formal way to say choose, but not in order to say "choose to do a job" unless that choice was by voting. For example, "I elected to stay home that day" means I chose to stay at home that day, and it's a bit formal and stilted but perfectly normal. But "I elect you to do this job" doesn't make sense unless you're suggesting you did it by voting.