BANGOR, Maine — A U.S. Bankruptcy Court approved a tentative sale agreement Thursday that will allow a New York City-based global investment firm to buy for $15.85 million the railroad freight company that owned the runaway train that killed 47 Canadians last summer.

Judge Louis Kornreich formally approved the Montreal, Maine and Atlantic Railway’s sale to Railroad Acquisition Holdings LLC, an affiliate of New York-based Fortress Investment Group. The decision came simultaneously with a Canadian bankruptcy court proceeding. The $15.85 million deal is expected to be closed by mid-March, said Robert Keach, the railroad company’s trustee in its bankruptcy proceedings.

“We think this is a very good sale for the state of Maine, for the region, for the railroad. Fortress is a proven operator. They have access to capital and I think this will ultimately be a very good thing for the state and for the railroad,” Keach said Thursday.

Attorneys working for the parties involved said they expected to have a completed agreement for Kornreich to sign by Friday morning.

A Railroad Acquisition Holdings official who attended Thursday’s proceeding declined to comment afterward. A call to the company’s office was not immediately returned.

Railroad Acquisition Holdings began the bidding with a stalking horse bid of $14.5 million. In a bankruptcy auction, the stalking horse is a company that promises to buy the bankrupt company’s assets for a certain price unless a better and higher bid is obtained during the auction process.

Keach said last month that roughly 20 potential buyers, including Railroad Acquisition Holdings, emerged in the process to secure a stalking horse, some of whom visited the railroad company’s operations to peruse the assets.

MM&A filed for Chapter 11 bankruptcy in U.S. Bankruptcy Court in Bangor on Aug. 7, 2013, a month after one of its trains rolled driverless down a hill before derailing in the middle of the town of Lac-Megantic, Quebec, causing an explosion that killed 47 people on July 6.

The Hermon-based railroad laid off 79 company workers, including 60 Americans, in the wake of the runaway train disaster. About 30 were hired back thanks partly to a loan the company secured that would allow it to run through February.

Keach said the sale is proceeding with the understanding that the company would hire to fill most of the positions vacated by the layoffs.

“They certainly have committed both to the court and to us that they intend to operate on both sides of the border and that’s a good thing,” Keach said.

The rail line through Lac-Megantic reopened on Dec. 18. Connecting Montreal to the Maine border, the line is a key component to the MM&A rail network, company officials have said.

Keach said that Fortress would likely be more forthcoming about its plans for the railroad once the bankruptcy sale is final. Montreal, Maine and Atlantic is one of the biggest companies in Piscataquis County, with a large rail repair yard in Derby and lines that connect Maine to Canada and to Eastport, which state officials see as a good and growing conduit to worldwide sea trade.