JOHANNESBURG, South Africa (AP) _ Police battled striking black railway workers wielding axes today in Johannesburg, and witnesses said at least three blacks were killed.

The South African Press Association quoted a police statement as saying five strikers were shot to death at the Doornfontein train station. But the news agency later said it was not clear whether five or three people were killed.

A news photographer said he saw at least three bodies after police battled strikers in a running battle between the union headquarters and the train station. A shopkeeper near the train station said he saw at least four dead strikers.

The government Bureau for Information, the official source of reports on unrest under the state of emergency, said only that three policemen were seriously injured and police shot and wounded three of their attackers. The bureau reported only one death, in a separate incident in the suburb of Germiston.

Union officials said police fired guns and tear gas outside union offices in Germiston, southeast of Johannesburg, severely injuring at least two people.

The various reports on the number of deaths could not be reconciled immediately.

Railway workers gathered at Doornfontein station today after it was announced that the government transport services was firing 16,000 striking rail employees.

Mike Roussos, spokesman for the South African Railway and Harbor Workers Union, said the union received ''reports of a number of clashes between SARHWU (union) members and security forces,'' prompting a group of armed strikers to set out for Doornfontein station.

News photographer Juhan Kuus said he saw 50 black men carrying axes and clubs march the half-mile from the union building to Doornfontein station.

He said police blocked their path, and an officer who tossed a tear gas canister was thrown up against a wall, beaten and stabbed. Kuus said police opened fire and he later saw at least three dead strikers and two severely wounded policemen.

Earlier reports had indicated the police opened fire on the crowd before the 50 black men arrived, but it was not clear if that was the case.

After the clash, some strikers returned to the union building, which houses offices of the nation's largest labor federation - the Congress of South African Trade Unions - as well as the railway workers union, which is spearheading the six-week-old strike.

Hundreds of police, some armed with automatic rifles, surrounded the building and announced through loudspeakers that no one was to leave. Approximately 500 people, including journalists, were believed to be inside.

The South African Transport Services, the rail company, set this morning as the deadline for 18,000 striking workers to end their strike or lose their jobs. Company spokesman Dirk Buekes said about 2,000 had returned to work, and those still on strike were regarded as having ''terminated their services.''

In Soweto, tens of thousands of people stayed away from work and school today after anonymous pamphlets calling for a three-day boycott were distributed in the black township outside Johannesburg.

The boycott was held to protest evictions and police measures, but many residents were forced to stay home because stone-throwing militants disrupted bus and taxi services.

Witnesses said police fired tear gas to disperse hundreds of Sowetans who were marching toward the town council's offices to protest its eviction campaign, which is aimed at ending an 11-month rent boycott. The government confirmed that police used tear gas against demonstrators but did not elaborate.

The pamphlets also reiterated other demands of anti-apartheid organizations, calling for an end to the 10-month-old state of emergency and removal of security forces from the townships.

The rail strike began March 13 to protest the dismissal of a driver on charges he misused company funds. He was reinstated and his punishment reduced to a $40 fine. The South African Railways and Harbor Workers Union is demanding his unconditional reinstatement, pay for the time the strikers have not worked, and recognition of the union instead of an in-house black staff association.

By law and custom, apartheid establishes a racially segregated society in which the 24 million blacks have no vote in national affairs. The 5 million whites control the economy and maintain separate districts, schools and health services.