I might call him a two-time loser or a double loser. He has been twice-beaten or twice-defeated. (Those last two hyphens are optional.) I'm not sure these are really idioms. One trite phrase that fits is that he found himself "up a creek without a paddle." (A canoe reference.) Since he has lost two jobs, you could give it a clever twist and say that he was "up a creek having lost both paddles." A canoe usually has two occupants and two paddles.
By the way, contested is not the right word for participating in an election as a candidate. You could say that he ran for public office or he was a candidate for the legislature.
Contested sounds OK to me. Not really common, but it sounds OK. I can't think of the usage though. Like he contested for legislature maybe.....I know I've heard it used......
And I agree with missFit. Those are what I would use.
The only idiomatic expression I know for a person who has forsaken one opportunity in order to seek, and fail to attain, something else is rather rude. I suggest you avoid it, or its more pungent variations, in any written or formal setting.