By making a series of embarrassing compromises, Prime Minister Massayoshi Ohira has stubbornly managed to remain in office, but both his friends and foes doublt that he will be able to govern successfully in the coming months.

There is broad agreement by the politically well-informed that three months of election losses and unprecedented party in-fighting have left Ohira a lame-duck. His friends describe him as shaken and politically weak. Opponents assert that his recent debacles have ended the era when his Liberal Democratic Party can rule alone.

For this once strongly governed nation, a quarter-century system of avoiding political confrontation seems to have crumbled, leaving one of the closest U.S. allies with a weak government that is totering toward a coalition.

It is too soon to know if the advent of coalition rule here would affect foreign policy. But the change could come as early as next summer, according to politicians of both the ruling party and the opposition.

In the meantime, they say, Ohira will be vulnerable to continued attacks from angry factional leaders in his own party who are openly determined to bring him down as quickly as possible. Friends speak of a kindd of fortress mentality in the prime minister's office, a condition in which important decisions are made with an eye to appeasing enough enemies to stay in office.

The bad times for Ohira began in late summer when, against the advice of some friends, he called for a general election to give the conservative Liberal Democrats a solid working majority in the lower house of parliament. He failed, ending up with one seat less than before. Opposing factions blamed him for calling the election in the first place and for then losing it with an unpopular and hasty insistence on a tax increase.

Ohira angered them further by refusing to make the ritual offer to resign, which Japanese tradition would seem to have required under the circumstances. Other factions led by former prime ministers Takeo Miki and Takeo Fukuda and by Yashuhiro Nakasone retaliated by insisting that he resign.

In the normal course of party affairs, the power brokers would have gotten together privately and settled the dispute, papering over the crevices to give the appearance of unity. For reasons that still are not clear, it did not work this time.

Ohira and Fukuda went to an open confrontation in the parliament and Ohira narrowly won. None of the scars has healed.

"It is not very Japanese, is it?" commented a party politician when the battle was over.

The spectacle did little to raise the public esteem of the ruling party or politics in general. Leading newspapers charged all sides with a personal selfishness and a hunger for power that left the public interest ignored. Some party politicians have been struck with the hostile comments of long-time faithful voters.

"Many of our supporters say they are fed up with what they see in politics," said a party member of parliament. "Some of them say they may never vote again. I think we have lost the most from our own supporters. It doesn't mean that they're going to switch over and start voting for the Communists, but they may refrain from voting in the upper house election next summer as a show of displeasure."

This apparent loss of public respect for the party has spawned the widespread speculation that its days of total control are numbered and that the so-called "system of 1955" will be replaced. That system began 10 years after the end of World War II when two conservative parties merged to become the Liberal Democratic Party. For nearly 25 years, it was governed without help from any other party. Although from time to time it has needed to enlist help from conservative independents.

The decline naturally is a pleasant sight to Socialist parliamentarians like Masashi Ishibashi, who insists that, "What happened last month shows that Japan is at the gate of coalition politics." He sees the dominant party growing weaker, its support waning because of factional struggles and the recurring scandals its administrations have bred. Soon, he thinks, it will be forced to seek an accommodation with one or two smaller conservative parties or even a [TEXT OMMITTED FROM SOURCE] ing of the Buddhist-supported Komei Party. Party.

Ohira already has shown an inclination to move toward coalition politics. At the height of the power struggle, when his survival was in doubt, he offered one Cabinet seat to the small, conservative New Liberal Club in exchange for support. It only made his factional antagonists more hostile, and he hastily dropped the idea.

Now, however, some of the prime minister's colleagues gloomily admit that a future coalition may be inevitable.

"It is anathema to us," one of them said last week, "if it is taken in the sense of giving up Cabinet position to another party. A coalition was looked on as a kind of defeatism when Ohira proposed it." But he conceded that if the party goes on to lose the upper house election next summer, a formal coalition would be necessary.

As frightening as the likelihood of coalition sounds to party members, itt would not mean much change in policy direction for Japan. All of the party's contending factional leaders are conservative and the ideoloical differences between them are tiny.