South African Prime Minister John Vorster has agreed in principle to free elections in the disputed territory of Namibia with United Nations involvement in the polling for a new independent authority there, according to informed sources.

Vorster has long rejected such a U.N. role in the territory, also known as Southwest Africa. The immediate effect of Vorster's very generalized commitment is to shelve the elaborate constitutional and interim-government plan he has promoted for the territory.

The new reported commitments, which came under prodding from the United States and four other Western countries, may form a major part of the discussions Vorster is to begin here Thursday with Vice President Walter Mondale.

Mondale arrived in Vienna this morning from Spain for talks with Vorster, the most important business Mondale is scheduled to conduct on a 10-day, five-nation tour in Western Europe. He met today with Australian Chancellor Bruno Kreisky.

The Western nations that have been neotiating with Vorster on the future of Namibia are reportedly encouraged by his attitude, but they have asked the South African government to spell out exactly how the general commitments would be carried out.

Last night President Carter pledged publicly in Los Angeles that the United States will "take strong action" diplomatically if the South Africans "don't do something about Namibia." The vice president is expected to press Vorster for details of South African intentions there.

Until specific measures are agreed on by Vorster and representatives of the United States, France, Britain, West Germany and Canada, the reported new proposals cannot be considered a breakthrough, involved sources said.

Rhodesia and South Africa's own apartheid system will also be discussed. American officials say that a chief aim of the talks is to convince Vorster that he cannot buy American support for continuing apartheid merely by helping resolve the Rhodesian guerrilla war.

Such a linkage was implicitly established last year by then-Secretary of State Henry Kissinger, who sought Vorster's help on Rhodesia and then muted American criticism of South Africa's domestic political repression of blacks.

South Africa has refused to recognize the U.N. claim of authority over Namibia, which was colonized by Germany, occupied by South African troops in World War I and mandated to Pretoria by the League of Nations.

Citing South African attempts to introduce aparthed into the territory, the United Nations declared the mandate terminated in 1966. South Africa refused to give the territory up, but Vorster dropped the apartheid plan two years ago and instead promised independence by December 1978. A South African-chosen group of Africans and local whites were told to produce a constitution.

Vorster is now reportedly ready to jettison the constitutional proposals worked out in Windhoek, the territory capital.

Peter Katjavivi, information secretary for the South West Africa People's Organization (SWAPO), which has been waging a low-level guerrilla struggle against South African troops for a decade and which is recognized by the United Nations as the territory's leading political organization, has reported that Vorster agreed in the talks with the five Western nations to free elections for a constituent assembly on the basis of universal adult suffrage and secret ballots.

American officials traveling with Mondale refused to confirm or deny the details of the SWAPO report, beyond saying that it contained inaccuracies. An independent source confirmed the elections commitment, however.

[Results of a referendum of white in Namibia showed that about 95 per cent of those who voted favor South Africa's plan for a multiracial interim government, Reuter repored. Observers said that voters were aware that Vorster's plan was likely to be dropped and that the white vote was more generally reflective of an acceptance of a multiracial government.]