LISBON—Portuguese voters cast ballots Sunday in an election to determine whether Prime Minister Pedro Passos Coelho, who oversaw a bailout program that averted bankruptcy but imposed harsh austerity on the country, will keep his job or relinquish it to his Socialist rival.

The governing center-right coalition—which joins Mr. Passos Coelho’s Social Democratic Party with the smaller Democratic and Social Center Party—was slightly ahead of the Socialist party, led by former Lisbon Mayor Antonio Costa, in pre-election polls.

...