OTTAWA, Ontario — Canada beefed up its safety standards for railways on Tuesday, reacting to the Quebec train disaster earlier this month, and said that two “qualified persons” must run any train that hauls dangerous goods.

In an emergency directive, most of which takes effect immediately, the Transport Department also said that trains carrying dangerous goods must not be left unattended on a main track.

The July 6 Quebec disaster, in which 47 people died, occurred after a single engineer parked his train for the night on a main line uphill from the small town of Lac-Megantic.

The driverless train, consisting of five locomotives and 72 tanker cars full of crude oil, started rolling and accelerated into the center of the little lakeside town. There, it derailed and exploded into balls of fire, destroying the center of Lac-Megantic.

“The disaster brought to light several industry practices which have caused some concern,” said Gerard McDonald, Transport Canada’s assistant deputy minister of safety and security. “Given that, and with an abundance of precaution, we thought it would be prudent to implement these measures now.”

McDonald told a briefing that the government could well impose more regulations on the railway industry.

The new directive is line with recommendations made last week by the Canadian Transportation Safety Board, which has been investigating the cause of the crash, the deadliest rail accident in North America for more than 20 years.

Investigators are still searching for clues, but they have said the train’s hand brakes are one focus of their probe.

The train was operated by small rail company Montreal Maine & Atlantic, which has itself questioned if the engineer set enough brakes to hold the train in place before he left for the night.

The provincial government in Quebec says about 1.5 million gallons of oil leaked into the air, soil and water in and around Lac-Megantic after the crash. The disaster has drawn more attention to the ever rising volumes of oil being shipped by rail because North American oil pipelines are full.

Lac-Megantic Mayor Colette Roy-Laroche complained on Tuesday that MMA had not paid the three companies it had hired to help clean up after the calamity. She said the town has been forced to pay the companies more than $3.9 million to prevent them from downing tools.

“This is utterly deplorable on the part of MMA and it is totally unacceptable,” she told a briefing. The town has sent a formal demand to MMA insisting it pay up.

Yves Bourdon, a member of MMA’s board, declined to comment on Roy-Laroche’s remarks, citing advice from lawyers.

The disaster has prompted lawsuits in Canada and in the United States, where the guardian of a girl whose Canadian father died in the blast filed a wrongful death lawsuit in Illinois against a number of railway and fuel services firms.

A class action suit seeking damages has been filed separately in Quebec.

In its directive, Transport Canada also said operators must ensure unattended locomotives cannot be moved and that hand brakes are set on any train left unattended for more than an hour.

It gave operators five days to ensure that only authorized personnel can enter the front locomotive of a train that is parked unattended on a main line or on a siding.

Canadian Pacific Railway Ltd. and Canadian National Railway Co., Canada’s two main railroads, both said they have already tightened safety procedures.

Canada’s opposition New Democrats, who say the right-of-center Conservative government has not done enough to ensure rail safety, said the measures announced on Tuesday do not go far enough.

Although legislators are on their summer break, the New Democrats say the House of Commons transport committee should meet to debate rail safety. Members of the Conservative-dominated committee want to wait until official investigations are complete.