The frontrunner: a conservative who saved himself in the 2004 Boxing Day tsunami by hanging from a pylon. The challenger: a gay environmentalist who has made his name by talking peace to Somali rebels. One of them will be elected the next president of Finland on Sunday. But whether it is conservative Sauli Niinistö or Green party candidate Pekka Haavisto who moves into the modest presidential palace at Helsinki harbour, this election marks the end of the 30-year social democrat tenure.

As the two winners were celebrating their first-round success in January, the social democratic candidate Paavo Lipponen was giving a lacklustre speech to small flock of party faithful. His dreadful 7% of the popular vote was a bitter end to the career of a former prime minister and one of the leading European Social Democrats of his generation.

In his farewell speech Lipponen, 69, said he would give way to the young. This is a tough challenge in a party where the average age of members (a figure that used to be guarded like a state secret) is now well over 60. The future of the old ruling party looks bleak. This is not because the Social Democrats have failed, but rather because their ideas have succeeded so well.

Finland is one of those Nordic success stories where a strong economy comes with a relatively fair society. In the past couple of years, Finland has been at the top of charts for best schools in the world, income and gender equality, quality of life and the lowest levels of corruption. In 2010 Newsweek chose Finland as "the best country in the world".

These achievements can be largely credited to Social Democrats and their welfare state policies. They enjoy such support that even the conservatives don't dare to dismantle the system of free schools and universities, state-funded healthcare or benefits for the poorest. When talking about the crisis of the Finnish left, it should be remembered that their conservatives are way to the left of Britain's Tories. In a country where even the conservatives have labelled themselves "a labour party", what is the left needed for?

Furthermore, the Social Democrats have been unable to solve the dilemma between a national labour force and international markets. As Finnish industries have moved their operations into cheap labour countries, the Social Democrats have whined and cried but have been unable to offer credible alternatives.

In particular many young people are disillusioned with the Social Democrats whom they see as 1960s radicals turned into advocates of vested interests. With a support base of labour unions and pensioners, it's not easy to introduce innovative new policies.

Then there is Greece. Finland is one of the four remaining triple-A countries in the eurozone, but it too is facing cuts and tax rises. Many Finns are tired of picking up the bill for what they see as tax-dodging free-riding south Europeans. Their outrage has made life hard for the pro-European Social Democrats who have found themselves torn between international solidarity and populist sentiment at home. Indeed, in last year's parliamentary elections many embittered blue-collar workers turned to the nationalistic, anti-migration True Finns party.

From the far left the Social Democrats are challenged by the small Left Alliance, founded on the ruins of the pro-Soviet communist party in 1990. Lately the Left has been boosted by rising anti-capitalist sentiment. The young party leader Paavo Arhinmäki, a former street activist and an ardent Chelsea supporter, has the kind of student fanbase that Social Democrats can only dream of.

However, so far neither the True Finns nor the Left Alliance have fared particularly well. The result of the first round was a triumph for liberal-minded Finns. Both Sauli Niinistö and Pekka Haavisto are pro-Euro, cautiously pro-Nato candidates with years of international experience.

The former financial minister Niinistö is known for his austere economic policies and advocacy of Finland's euro membership. He used to work for the European Investment Bank in Luxemburg. Haavisto's humanitarian credentials stretch from Africa to the Balkans, Afghanistan to Iraq.

The second round of the presidential elections, with only two candidates left, always tends to divide and electrify the nation. This year the main thrill has been served by Haavisto, Finland's first openly gay presidential candidate whose partner is a hairdresser from Equador. Haavisto's success has brought with it personal threats but also a rare kind of enthusiasm among the artier, social media crowd. Even the country's most popular rock band of the 1990s played a comeback gig for Haavisto.

With all the fuss it is easy to forget that the conservative Niinistö holds a comfortable lead in the polls and is almost sure to finish first. Haavisto may have the indie vote, but mainstream Finland is tuned into more melancholic music.

• Follow Comment is free on Twitter @commentisfree