JOHANNESBURG, NOV. 8 -- Police have arrested five Zulu men and are looking for three others who, they say, carried out a massacre aboard a commuter train.

The five, who appeared in court today seeking bail, have been charged with the murder of 15 of 26 persons killed Sept. 13 when a gang of men went on a rampage inside a Johannesburg-to-Soweto commuter train shooting and stabbing passengers.

The terrorist incident led to widespread allegations that a "third force" of dissident white security officials was a "hidden hand" stirring up last summer's black political violence in which more than 750 blacks died in factional fighting, and so alarmed the government that it ordered a massive police crackdown in the townships a few days later.

However, evidence presented in court this week alleges that eight Zulu migrant workers living in a hostel for single men were responsible for the train attack as well as an earlier terrorist incident at the Jeppe railroad station here in which six persons were shot to death.

The eight are charged with 21 counts of murder and of inflicting injuries on 49 persons in the two attacks.

Four of the five defendants appearing in court today were identified by state attorney David Gordon as members of the Zulu-based Inkatha Freedom Party led by Chief Mangosuthu Buthelezi. According to the chief police investigator, Deon Wessels, the three men still at large fled to the Kwazulu homeland, located in Natal province. Buthelezi is chief administrator of the nominally self-governing homeland.

Court sources said Inkatha was paying the legal expenses of the five defendants. They are seeking bail, but state attorney Gordon said the five constitute a serious threat to public safety and might skip bail, and so should remain behind bars until their trial begins.

Inkatha supporters and those of the rival African National Congress fought pitched battles in the black townships around Johannesburg from late July to mid-September. In early September, terrorist hit-and-run attacks on pedestrians and train commuters in Johannesburg began taking place. The bloodiest of these was the Sept. 13 train massacre.

According to court testimony by Wessels, the investigator, the train attack was planned at a hostel in Jeppe after an Inkatha meeting there earlier the same day. A man he identified as Jericho Manyane then called another meeting to re- cruit members for an impi, a traditional Zulu military unit, to carry out the attack.

Wessels said the accused had heard that commuters attending a daily worship service aboard the train had been insulting and "praying for the death" of Buthelezi and Zulu King Goodwill Zwelithini.

Contrary to earlier reports of an indiscriminate attack on passengers, Wessels said the 15 persons the accused allegedly killed were taking part in a prayer service in one of the train's cars.

A witness, Anna Maleka, confirmed that a service was taking place at the time of the attack and said she was part of it. She was shot in the right arm and stabbed twice in the back but survived and identified two of the alleged assailants.

In an interview today, she denied that the worshipers had ever insulted or prayed for the death of Buthelezi and King Goodwill. "We never prayed for that," she said. "We prayed for our country. We prayed for peace and things like that."