(Reuters) - The railway whose runaway train killed 47 people in Lac-Megantic, Quebec, last month filed for bankruptcy protection in Canada and the United States on Wednesday as it faces mounting pressure from authorities to pay for the disaster cleanup.

Montreal, Maine & Atlantic Ltd (MMA) filed for bankruptcy in both countries to preserve the value of its assets for a potential sale, according to court documents filed with the U.S. Bankruptcy Court in Maine.

It said total monthly revenues of its Canadian and U.S. units had dwindled to about $1 million since the derailment, given the closure of its main line between Quebec and Maine.

"It has become apparent that the obligations of both companies now exceed the value of their assets, including prospective insurance recoveries, as a direct result of the tragic derailment at Lac-Megantic,Quebec, on July 6," MMA Chairman Ed Burkhardt said in a statement.

A hearing is scheduled for Thursday in Bangor, Maine.

The July 6 crash was the worst of its kind in North America in two decades. The driverless MMA train careened into the small, lakeside town of Lac-Megantic, where it derailed, causing massive explosions and a wall of fire that obliterated the town center and killed those in its path.

An estimated 5.6 million liters of oil spilled into the air and ground as well as into a nearby lake and river.

As cleanup costs and lawsuits piled up, Burkhardt had hinted that the company might opt for bankruptcy. It has already scaled back operations and laid off staff in Canada and the United States.

The Quebec government has ordered MMA as well as World Fuel Services, the company whose unit sold the crude the train carried, to pay for cleaning up the oil that spilled in the crash. The bill so far totals C$7.8 million ($7.57 million) and has been paid by the municipality of Lac-Megantic.

Burkhardt said MMA wished to work with authorities "in the continuing environmental remediation and clean-up as long as is necessary, and will do everything within its capacity to achieve completion of such goal".

The court documents also said the loss of much of the company's freight business occurred because Canadian authorities are not letting trains pass between Maine and Quebec on its line.

MMA's chief financial officer, Donald Gardner, said in the court documents that concurrent legal proceedings were filed in Canada to preserve the company as a going concern. The company said it had assets of between $50 million and $100 million and liabilities of up to $10 million.