Japanese voters will decide Sunday whether the Liberal Democratic Party must relinguish its 25-year monopoly on power and move into a new age of coalition with opposition parties.

Control of both houses of parliament is at stake in an unusually important election which also will shape the politics to produce a new prime minister to succeed Masayoshi Ohira, who died suddenly nine days ago.

The most recent newspaper polls, reversing an earlier trend, indicate that the Liberal Democrats will either maintain or slightly increase their narrow majorities in both houses. However, the projections are not usually reliable in predicting the exact number of seats to be won, and a relatively small shift of votes could tip the party out of total control.

The conservative, pro-American Liberal Democrats have ruled Japan since two parties merged in 1955 and have led the country to an age of unprecedented prosperity. But a series of corruption scandals, involving political funds, pay-offs, and bureaucratic irregularities, have shaved its popularity since the mid-1970s.

The party itself has become the main issue in an election testing whether voters are angry enough over its scandals and unending factional feuds to risk throwing it out of power and forcing it into a coalition with middle of the road parties.

National defense also has emerged as a serious issue, and the campaign has revealed a definite trend toward a stronger military in a country where pacifism has been the official policy since World War Ii.

All 511 seats in the lower house are being contested, with the Liberal Democratic Party needing a minimum of 256 to retain power. It now has 258 seats and the major opposition party, the Japan Socialist Party, has 107. The Liberal Democrats have a one-vote majority in the less powerful upper house, where half of the 252 seats are at stake.

The lower-house election was scheduled when the Ohira administration unexpectedly lost a no-confidence motion last month as a result of the intense factional feuding that marked his year and half in office. Then Ohira suddenly died of a heart attack on June 12, leaving is party leaderless in mid-campaign.

The no-confidence vote an Ohira's death initially appeared to threaten the Liberal Democrats' hold on power. But the factions have largely papered over their differences and united against the opposition. Some observers also believe Ohira's death helped the party in that it seems to have attracted a sympathy vote.

If the Liberal Democrats fail to get a majority of their own, they would be forced to seek a coalition with the New Liberal Club, the Democratic Socialist Party of the Komeito or all three. The first is a conservative splinter, and the Democratic Socialists are a conservative party backed by private labor unions. Komeito, the so-called "clean government party," is supported by Buddhist organizations.

Their inclusion in a coalition government would not markedly change Japan's pro-American international posture. Only a disastrous Liberal Democractic loss and a very large gain by the Japan Socialist Party -- a shift great enough to produce a Socialist-led coalition -- could force any great changes either domestically or internationally.

Sensing the Liberal Democrats' weakening appeal to voters, the Socialists and Komeito early this year agreed to cooperate with joint candidacies in many districts. In varying combinations, they and the Democratic Socialists are fielding jointly endorsed dandidacies in 42 lower house districts and 25 upper house districts, more than in any previous elections.

The opposition has pilloried the Liberal Democratic Party for its interminable factional feuding and the long chain of corruption cases that date back to the Lockheed scandals of the mid-1970s. "Corruption and corruption and corruption" is the charge leveled by Socialist Party chairman Ichio Asukata.

Placed on the defensive, many Liberal Democratic candidates are promising to support a party reform that would dissolve the major factions, a promise that has been made frequently in the past. Younger members are arguing publicly for aparty regeneration that would place new leaders in places of power.

The campaign also has brought to the surface Japan's growing willingness to support national defense measures, including the country's controversial mutual security pact with the United States. This is a product of heightened fears of the Soviet Union brought to a head by the Soviet invasion of Afghanistan.

Long a taboo topic in Japanese politics, defense has been discussed openly the past two weeks and it appears that a new consensus is emerging that embraces every political party except the Japan Communist Party.

The two Liberal Democratic leaders most likely to contest the premiership in a post-election struggle have both talked of increasing defense spending. Yashuhiro Nakasone has long championed a larger defense force and his likely opponent, Toshio Komoto, is on record favoring at least a modest increase in military spending.