BUENOS AIRES, SEPT. 6 -- President Raul Alfonsin suffered a major electoral setback tonight as his Radical Civic Union lost key gubernatorial and congressional races to a reformed and reinvigorated Peronist movement.

The surprise defeat threw into question Alfonsin's future ability to enact a series of sweeping military, economic and constitutional changes aimed at strengthening Argentina's young democracy.

It also catapulted Peronist Antonio Cafiero, the projected winner of the prized governorship of Buenos Aires Province, to the front ranks of possible contenders for the presidency in 1989.

With more than half of the official returns counted, the Peronists appeared to have won the key Buenos Aires governorship and 15 others, for a net gain of four governorships. In nationwide congressional contests, the Peronists were winning 41.1 percent to the Radicals' 37.9 percent of the vote.

In Buenos Aires Province, Cafiero, a 64-year-old economist and veteran politician, was strongly outpacing his Radical opponent, 47 to 39 percent.

Preliminary results also indicated a gain for the small rightist Democratic Center Union in the federal district of Buenos Aires.

The balloting marked the first time in 25 years that the electorate in this coup-plagued country had been given the opportunity to vote their judgment of provincial governors and congressmen they had elected previously.

But hanging in the balance with the outcome of today's vote was Alfonsin's own agenda for reshaping some of the institutional foundations of Argentina.

Many political analysts said the Radical party's poor performance would affect Alfonsin's ability to push ahead, during his final two years in office, with plans to restructure the armed forces, sell off state-owned firms and adopt a parliamentary system of government.

The Peronists, under the new leadership of their reform wing, have been hoping for an electoral resurgence to establish themselves as a real political alternative.

At stake were half of the 254 seats in the national Chamber of Deputies and 21 of the country's 22 governorships, as well as nearly 10,000 other regional and municipal posts.

Going into the election, the Radical party had appeared in danger of losing its thin absolute majority in the lower house of Congress but had been favored to win the much-coveted governorship of Buenos Aires Province, home for 37 percent of the nation's 19.4 million voters.

Both major parties considered the Buenos Aires race crucial.

Victory or defeat there was expected to carry an enormous psychological impact, extending far beyond the political clout of the governor's post.

Running against Cafiero was Radical candidate Juan Manuel Casella, a 46-year-old lawyer who has served brief stints as a congressman and minister in the Alfonsin government.

Casella and other Radical candidates linked their campaigns closely to the popular Alfonsin, prominently featuring the president's image in political ads and calling the election a vote of confidence in him.

The Radicals warned that a Peronist win would alter the stability and continuity of the democratic system, a message that is meant to play on memories of the political violence that terrorized Argentina under the last national Peronist government in the mid-1970s.

The Peronists, in turn, highlighted the country's continuing economic problems. They argued that if the Radicals win, Argentina will not get out of its crisis.

Moreover, many analysts had said that a Radical win would have thrown the Peronists into another internal party crisis, leaving the prolabor movement without a clear center of reference and Argentina without a strong opposition party. Cafiero is the leader of the dominant, moderate group in the Judicialist Party, the formal name of the party founded by the late president Juan D. Peron.

Alfonsin's election in 1983 ended nearly eight years of repressive military rule. The modest president won support by choking hyperinflation with a package of shock measures in 1985 and placed the new democracy on firm moral ground by putting former military leaders on trial for crimes during their rule.

Alfonsin also has earned international respect for support for human rights and his insistence that payments continue on Argentina's $52 billion debt.

But recent months have seen a rise in public irritation and disillusionment. Inflation has been edging up again, reaching 10.1 percent in July and, according to unofficial estimates, 13.8 percent in August. The trade imbalance has deepened and strikes have upset public services.

The armed forces, too, are restless. Uprisings by military officers last April dramatized resentment in the ranks over the trials. Alfonsin pushed through legislation in June that forced the cancellation of legal proceedings against more than 200 officers. Army leaders are still pressing for a full amnesty and official vindication of their role in the undeclared war against suspected leftist guerrillas.

Recognizing a national mood of disenchantment with the workings of democracy, Alfonsin appealed for pragmatism and patience in a final campaign speech last week. "Democracy is a system of good sense and common sense," he said. "It is not a system of magic."

With historically close ties to the powerful trade unions, the Peronists favor increased spending on social programs, public works and industrial development. They say such funds could be obtained in part by declaring a moratorium on foreign debt payments.

One new feature in the campaign was an exceptionally heavy use of television, relegating political street rallies to a secondary role. For the first time, too, the country was treated to a televised debate between candidates, featuring Casella and Cafiero.

Violence between rival groups flared only in the last few days. One confrontation resulted in the shooting death of a 19-year-old Peronist and the serious wounding of another.