JOHANNESBURG, South Africa (AP) _ A magistrate today banned a protest march by black trade unions, but activists proceeded with plans for a mass rally featuring recently freed leaders of the outlawed African National Congress.

No reason was given for rejecting the application by the Congress of South African Trade Unions to hold a march Saturday in Vereeniging, an industrial city south of Johannesburg. The labor federation, which had sought to protest legislation restricting unions' ability to strike, threatened to defy the ban.

Since mid-September, the government has allowed numerous protest marches nationwide, organized by trade unions and other anti-apartheid groups. The government has approved Sunday's rally at a soccer stadium near Johannesburg welcoming the freed African National Congress leaders.

Seven of the eight men to be honored were freed unconditionally on Oct. 15 and the other was released in November 1987. Six were sentenced to life imprisonment at a 1964 treason trial along with Nelson Mandela, the congress' best-known leader, who remains jailed.

White extremists have threatened to disrupt the rally with violence, said Gen. Herman Stadler of the police public relations division. Stadler said the threats were made in telephone calls from two men to the Afrikaans-lang uage Free Weekly.

Organizers hope to draw at least 80,000 people to the rally, which would make it the largest anti-government gathering ever in South Africa. Buses and black-owned mini-bus taxis will bring people from distant communities.

Dozens of foreign diplomats have been invited to attend, said Murphy Morobe, one of the organizers. On Thursday, diplomats from 18 countries, including the United States and most of Western Europe, visited Walter Sisulu, the highest ranking the freed African National Congress leaders.

Under South Africa's Internal Security Act, it is crime to promote the objectives of the African National Congress, which has waged an anti- government bombing and sabotage campaign since 1961.

Police will ''closely monitor'' the rally but will allow it to proceed, said a police spokesman, Maj. Gen. Herman Stadler.

Several Johannesburg newspapers today ran advertisments for the rally that made no mention of the African National Congress. But New Nation, a militant anti-apartheid weekly, carried a full-page display of the program for the rally, under the heading ''ANC Lives, ANC Leads, ANC Speaks.''

In an editorial, New Nation said the rally marks the start of a new phase ''in which we seek to reveal the ANC's centrality in the solution of South Africa's problems.''