* Negative court ruling stoking strains in three-way coalition

* But no viable alternatives for majority in parliament

* All parties would stand to lose from new elections

* Crisis seen benefiting mainly far-right

BERLIN, Nov 21 (Reuters) - A court ruling that risks torpedoing key aspects of the German government's legislative agenda has further strained the coalition but is unlikely to split it as all three parties currently stand to lose from a breakup.

The constitutional court last week ruled illegal a budget manoeuvre that would have reallocated 60 billion euros of unused pandemic funding to green initiatives, unexpectedly blowing a hole in the government's financial plans.

The decision has increased tensions within Chancellor Olaf Scholz's coalition, in particular between junior partners the Greens and the Free Democrats (FDP).

The former favour generous spending to help with the transition to a carbon neutral economy, even if it means suspending the debt brake that restricts the public deficit to 0.35% of GDP, while the FDP emphasises fiscal rectitude.

Some party members are questioning if it makes sense to keep sticking together.

"No coalition is an end in itself," Philipp Tuermer, the new head of the youth wing of Scholz's Social Democrats (SPD) told Tagesspiegel newspaper at the weekend, in an interview that was highly critical of the government.

But the parties are likely to hammer out a compromise no matter how great their divisions, analysts say, because they would all stand to lose from fresh elections and no workable new majority appears possible in the current parliament.

They also note that the coalition has actually pushed forward with its ambitious, progressive legislative agenda despite a series of crises beginning with the war in Ukraine.

A September survey by the Bertelsmann Foundation found it had implemented or started implementing two-thirds of its proposed agenda, including measures to liberalise citizenship laws and boost immigration by skilled workers.

If Scholz dismissed his partners, for example, the SPD would need to join forces with the opposition conservatives to form a majority government - a coalition a majority of voters currently favour, according to polls.

However, as the conservatives are currently topping polls with twice the support of the SPD, they have no incentive to play second fiddle, said Stefan Marschall, political scientist at the University of Duesseldorf.

"Why should the conservatives stabilize a chancellor they have continuously criticised?" he added.

The conservatives would be prepared to enter a Scholz-led government only for a few months before new elections, a senior party source told Reuters.

But Scholz is unlikely to call for new elections as they would not benefit any of the coalition partners. Both the SPD and FDP are polling significantly below what they scored in the last federal elections, at around 16% and 5.5% respectively compared to 25.7% and 11.5% in 2021.

"For the FDP, new elections could even threaten their existence," Ursula Muench at the University of Tutzing told German outlet Merkur, pointing to the 5% threshold needed to enter parliament.

The Greens are polling roughly the same as in 2021, at around 15%, but current surveys suggest their only chance to govern would be as part of another unwieldy three-way coalition.

And new elections aren't even in the conservatives' interest, said Frank Decker, political analyst at Bonn University. Leader Friedrich Merz is unpopular with the public, meaning they would have to decide on a candidate for chancellor, then deal with the budget mess themselves if they won.

Eurasia Group puts the odds of Scholz's government completing its four-year term at 90%, down from 95% prior to the court ruling.

"Scholz definitely wants to keep the government together and believes this will work as none of the three coalition partners stand to benefit from a break," a source close to the chancellor said. "The situation is being seen as a political poker game"

MORE FUEL FOR FAR-RIGHT?

Scholz's government - the first coalition of the ideologically disparate SPD, Greens and FDP at national level - is currently among the least popular in the history of modern Germany, according to polls.

The coalition took power just before Russia's invasion of Ukraine - and the subsequent reckoning for Europe's largest economy, which had long relied on cheap Russian gas - and has become notorious for its public infighting.

On Monday, FDP leaders argued for cuts to social welfare to help make up the new funding gap while the SPD and Greens railed against that proposal, arguing for suspending or reforming the debt brake. Introduced via a constitutional amendment following the 2008/09 global financial crisis, the debt brake aims to keep Germany's public finances sustainable but some now see it as an obstacle to investments that could boost economic growth.

"A government that is so divided and is regularly shot down by the constitutional court cannot provide the necessary leadership and security in a crisis," Bavarian conservative premier Markus Soeder said this weekend.

"In reality, the chancellor should dismiss his coalition partners now."

And although the court ruling was prompted by a complaint they lodged, it could cost the conservatives themselves, hitting the finances of several states they govern. They also risk being blamed for the ruling's impact on the economy, already teetering near recession.

"Their complaint is going to end up falling on their feet," a government source said.

The sole winner could be the far-right Alternative for Germany, which has surged to second place in nationwide polls over the past year.

"The AfD can draw political capital from the dissatisfaction with the government without lifting a finger," said Decker.

"And the strength of the AfD is also the reason why no actors - not even the conservatives - currently have any interest in new elections." (Reporting by Sarah Marsh, Andreas Rinke and Holger Hansen; Additional Reporting by Alexander Ratz; Editing by Catherine Evans)