Afters years of edging toward power, Japan's Socialist Party is reeling under a series of setbacks that reveal its weakening influence on Japan's political life.

Its candidates were drubbed in two recent rounds of local elections and polls depict declining support among union members. Moreover, a subtle shift to the right in national politics has shaken the Socialists' hope of ruling Japan some day as the core of a left-of-center coalition.

Socialist leaders acknowledge the setbacks as serious but insist they are a short-run phenomenon soon to be reversed. Opposition parties and independent critics disagree. Kiyoshi Iijima, a prominent political analyst, points to a persistent loss of support at the polls and predicts a serious defeat amounting to a loss of 10 or more seats in the next parliamentary elections.

He and many other observers believe the losses reflect a declining public trust in the Socialists' ability to manage big government and a growing preference for undogmatic administrators who can cut costs.

In recent elections, a large member of Socialist mayors and governors were replaced by moderate candidates who promised efficient government instead of ideological purity and who were supported by several conservative and centrist parties.

The elections abruptly reversed a trend toward local Socialist victories that began in the early 1960s in a wave of dissatisfaction with the Liberal Democratic Party, the conservative, business-oriented party that has ruled Japan's national government since 1955.

In 15 city and prefectural (provincial) elections last month, Socialist candidates were swamped, failing to win a single gubernatorial victory of their own or in alliance with the Communist Party. Candidates supported by the Liberal democrats and middle-of the-road parties swept all 15 elections. In four of those contests, the Socialists had joined the broad coalition instead of filing opposing candidates.

The major socialist loss was in Tokyo, where a colorless, 68-year-old administrator, Schunichi Suzuki, was elected governor with the support of liberal democrats and other parties.

Tokyo had been governed for 12 years by a popular academic-turned-politician, Ryokichi Minobe, who was supported by Socialists and Communists and whose time in office symbolized the rise of leftists in local politics. Minobe did not seek reelection.

Minobe left Tokyo deep in debt and nearly bankrupt, a legacy of his policy of granting large wage increases to municipal workers. His successor campaigned on a promise to restore Tokyo's financial stability.

The Result in Tokyo is regarded by analysts as symbolic of the national trend away from big spenders and toward more cautious management.

Socialists had an easy time dispensing public funds in the era of Japan's high economic growth but the recession of the early 1970s caught them in a tight pinch, observes political analysts Iljima.

"After the oil shock" of 1973, he adds, "you could not assert a utopian policy for everyone."

In the process, the Socialist Party lost support even within the ranks of union members who still provide most of its popular base. One recent poll showed that only one-third of all union members support the party now.

None of Japan's established parties are exactly flourishing, and many victories this spring went to candidates either not identified with any party or supported by a mixture of parties spanning the conservative-centrist spectrum. In local assembly elections, independents more than doubled their number of seats while all major parties except the Communists lost ground, or barely held their own.

Socialists attribute their setbacks to temporary reasons involving the economy. A leading party member in parliament, Masashi Ishibashi, said the recession has severly limited the activity of labor unions, the party's main pillar of support, and predicted that the tide will turn in a few months when a wave of consumer price increases will hit Japanese families. He also concedes that conflicts among socialist countries-principally between China and the Soviet Union-have caused deep splits within the Japanese party.

On the national scene, the Socialists have seen their expectation of sharing power deminished by the recent change of plans by two smaller parties, the Komeito (Clean Government Party) and the Democratic Socialist Party.

Both of those middle-road parties recently have begun looking toward alliances with the Liberal Democrats. At one time, both had envisioned a coalition with the Socialists to attain control of the government.

Komeito, the larger of the two has virtually abandoned the Socialists, largely because of differences over military defense. The Socialists' platform insists on "unarmed neutrality" for Japan and advocates dissolution of the armed forces.

Junka Yano, Komeito's secretary-general, said in an interview that his party had hoped for many years that the Socialists would abandon their antimilitary stance and adopt a more "nationalistic position."