There are no hard and fast rules for writing stories. However, I can tell you what works for me in short story writing.
Working back from the ending
As I mentioned in this answer, I like to work from the punchline backwards. In your case, the result of the election is the punchline (or kicker). What would make that ending feel like a shock? What needs to happen to cast doubt on the outcome? What is the least writing I have to do to get the reader emotionally invested in that outcome and make them cheer when it happens?
For horror, my favourite trick is to take something nice and good and show at the last minute a dark version. For a happy ending, I would set up expectations of failure (unhappy ending).
I would probably imply, through plot-advancing dialogue that at least one of the characters is despondent about their chances. Perhaps the candidate had some news get out about a thing he did years ago. They are bracing for a loss. Then just as all hope is lost, someone reports that some significant demographic celebrated either the honesty of his confession or the deed itself. Thus he wins much to his own surprise.
Making the ending feel like a twist
The definition of a twist ending is where the plot is heading one way only to flip at the last possible moment. That flip can be a reversal of circumstances, a subversion of expectations, or a sting in the tail (pun intended).
A lot of those twist ending types are the writer's equivalent of sleight of hand magic. You distract the audience by getting them to look at the glamorous assistant so they do not see you manipulate something else on the other side of the stage.
Being a comedy writer (sometimes), what I would almost certainly do is have him realise the day is lost and end up making a bet to do something extreme if he wins. Sky-diving, crocodile wrestling, streaking at a football match, the more "oh crap!" the bet, the better. That way, the win is good but... Oh, no! What did he just agree to?
Emotional pay-off
Romance books are satisfying not because it is a surprise that boy and girl live happily ever after but because the journey to that ending was itself satisfying. The ending is the emotional pay-off for the journey.
All of my prefered short story methods are working towards the same goal. To make the ending give the reader an emotional pay-off. To leave the reader feeling like they had a satisfying reading experience. I either want a shiver (horror) or a laugh (comedy).
In your case I would ask myself, why could this win be emotionally satisfying? What stakes could I have put in place to give this result urgency? How can I imply there are many other possible endings? How can I make my reader really care about getting the ending I will give them?
If you can answer those questions with your story, the ending will quite likely be most satisfying; even if they see it coming.