Lech Walesa, the unemployed electrician who became the symbol of the Polish workers' revolt, today defeated three more-radical candidates for the leadership of Poland's independent Solidarity trade union.

His victory, the climax of a six-month election campaign in Solidarity, was confirmation of his charismatic hold over the union's 9.5 million rank-and-file members. It also came as a relief for the Communist authorities who have learned to respect his moderate policies and would have found it very difficult to negotiate with any of his rivals.

Although Walesa was elected Solidarity chairman on the first ballot, the results showed that a large percentage of the delegates voting at the union congress favored his more radical opponents. Walesa won 462 out of 837 valid votes cast (55.2 percent), meaning that about 45 percent of those voting opted for the radical candidates. There were 48 abstentions and seven invalid votes.

In individual comparisons, the margins were much greater. Walesa's nearest rival was Marian Jurczyk, who led last year's strike in the northeastern port of Szczecin and won 201 votes (24 percent). Andrzej Gwiazda, Solidarity's outgoing deputy chairman, won 74 votes (8.8 percent), while the ultra-radical Jan Rulewski polled just 52 votes (6.2 percent).

The nature of Walesa's victory pleased many delegates since they regarded it as an endorsement of his own achievements and personality while also a constraint on his sometimes authoritarian style of leadership.

After announcement of the result, Walesa was mobbed by photographers and supporters shaking his hand and proffering red and white roses, the Polish national colors. The delegates in the Olivia Sports Hall, site of Solidarity's first national congress, rose to sing "Sto Lat, Sto Lat," May he live a hundred years -- the Polish equivalent of "For He's a Jolly Good Fellow."

Beaming and thrusting his arms into the air in a characteristic victory sign, Walesa thanked the delegates for electing him "even if only just."

"I'll be the first up front and the last to abandon ship . . . the struggle will be tough but I will rely on you for advice," he promised.

Although Walesa was already the de facto leader of the union, his only formal post until now was the chairmanship of the Gdansk regional Solidarity. His election to the national post had been widely regarded as inevitable in Poland in view of the immense personal following he has built up since emerging as the leader of a shipyard strike in Gdansk in August 1980.

The unrest spread rapidly to the rest of the country, toppled the Communist Party leadership and had repercussions throughout the Soviet bloc.

Even his principal opponents recognized that there is no alternative to Walesa as Solidarity leader. But they were anxious to demonstrate the existence of different currents of opinion within the union and prevent the emergence of one-man rule.

Walesa's efforts to organize independent unions dates back to his arrest in 1970 for leading shipyard strikes of that year. Dozens died in riots that resulted.

Speaking at a press conference following his election, Walesa said that he had deliberately not attempted to woo the delegates with attractive promises during a debate among the candidates last night. His low-key speech contrasted with the tough rhetoric of his rivals, particularly Rulewski, who suggested that Poland should review its alliance with the Soviet Union.

Solidarity officials said that the fact that Walesa had managed to win the election, without compromising his moderate position, augured well for new talks with the government. Negotiations between the two sides had been virtually suspended over the past few weeks following the stream of radical resolutions from the first stage of the Solidarity congress and the propaganda campaign launched by the authorities.

In contrast to his opponents, Walesa favors a policy of gradual change and compromise with the regime. This view is also shared by most of the professional advisers to the union who feared violent conflict and even Soviet intervention, had a more radical line prevailed.

Walesa, 38, told the press conference that the Polish political system should be based on three pillars: a strong trade union, a strong Communist Party apparatus, and a strong mechanism of workers' self-management in factories. This, he said, could lead to a new political stability and economic recovery.

He made no mention of the demand for free elections that was contained in a resolution during the first stage of the congress and repeated by rival candidates during their more stormy campaign speeches.

Walesa anticipated broad changes in the union's national and local leadership. "Immediately after the congress there will be disorder in the union which will last for two to three months," he said, adding, "but after two months, it will get stronger."

Stressing the need for accord with the government, he said, "if that fails, we will have to think about something else." He did not say what that was.

In his acceptance speech, Walesa once again put a strong accent on unity by saying that he did not intend to represent any of the union's factions. Addressing his radical opponents, he said: "If you don't want to help, then at least don't obstruct me.

"United we can move forward to victory."