Save money, kill the current ruler, buy a win. Job done.

The AI seems to spend its money on upgrades rather than buying the election, so long as you prioritise buying the election there's almost never a reason to lose it. Only time I've ever lost it is because I've either decided I wasn't willing to buy it for the price it currently cost, or there were two elections in quick succession, or I've been fighting a war that was harder than I expected so I've withdrawn my election fund to hire more Mercs.