JOHANNESBURG, South Africa (AP) _ A South African coal mine's second underground explosion in five years killed 34 miners and injured 16, and a top union leader Friday accused the owners of doing too little to avert such disasters.

The mining company said methane gas may have caused Thursday night's explosion at the Ermelo coal mine in eastern Transvaal province 130 miles east of Johannesburg.

Thirty-one blacks and three whites were killed, apparently by carbon monoxide fumes, General Union Mining Corp. said in statement issued Friday about 10 hours after the blast. Sixteen black miners were injured in the explosion 430 feet underground.

''The accident is suspected to have involved methane gas,'' said the company, known as Gencor, ''but the actual cause is still under investigation.''

Methane is a colorless, odorless, highly flammable gas found naturally underground.

The National Union of Mineworkers, which represents more than 300,000 black miners nationwide and about 800 at Ermelo, accused Gencor of failing to implement adequate safeguards following a methane gas explosion that killed 11 men at the mine in November 1982.

Cyril Ramaphosa, the union's general secretary, also noted that Gencor owned the Kinross gold mine, where 177 miners were killed in an underground fire last September.

''Gencor is emerging as the butcher of the mining industry,'' Ramaphosa said at a news conference. ''It is bent on destroying as many lives as possible.''

Steve Ellis, chairman of the Gencor subsidiary that operates Ermelo, said when asked for a reply: ''We are deeply grieved at this tragic loss of fellow workers and do not intend to respond to such tasteless allegations.''

On Wednesday, 16 miners were injured in a methane gas explosion at another eastern Transvaal coal mine, run by the state-subsidized Sasol energy company.

Gencor identified the dead whites as an electrician, Petrus Pieterse; a fitter, Abel Erasmus; and miner Andre Veldsman.

The identities of the dead black miners, many of whom were migrant laborers from distant rural areas and other countries, were to be released after their relatives are notified.

Gencor said six of the injured miners were in serious condition from carbon monoxide poisoning and were taken to a special mine industry hospital in Johannesburg. The other 10 injured were reported in satisfactory condition at the Ermelo Hospital.

South Africa's worst mining disaster occurred Jan. 21, 1960, when 437 miners were buried alive at the Coalbrook North Colliery, near Sasolburg south of Johannesburg.