The federal government is threatening legal action if the company that owns the only rail line to the northern Manitoba town of Churchill does not resume rail service in 30 days.

The government has been working toward the restoration of the rail line through conversations with prospective buyers and negotiations with stakeholders, but Denver-based Omnitrax has not met its obligation, said Minister of Natural Resources Jim Carr in a statement released Friday.

Churchill, a community of 900, is located about 1,000 kilometres north of Winnipeg on the western shore of Hudson Bay.

"Transport Canada sent Omnitrax Inc. a notice of default of its agreement, demanding that it complete all railway repairs and resume rail service within 30 days. Failing this, Transport Canada will instruct Justice Canada to file a lawsuit for breach of contract," the statement said.

The federal government recently said it would seek repayment of $18.8 million — the amount it contributed to the Hudson Bay Railway line in 2008 — when Carr "formally demanded" Omnitrax fix the line at the start of September.

But Friday's legal threat sent a message to Omnitrax that the federal government "has no intention of constructively solving this problem," said a statement from Merv Tweed, president of Omnitrax Canada.

"It appears from their collective indecisiveness, dysfunction and lack of leadership on this critical issue that both Canada and the Province of Manitoba are content to leave Churchill as a remote, fly-in community for the first time in over 100 years," Tweed said.

Omnitrax, which also owns the now-closed Port of Churchill, bought the rail line and the Hudson Bay Railway Company from the province in 1997.

The federal government is threatening legal action if the company that owns the only rail line to the northern Manitoba town of Churchill does not resume rail service in 30 days. 2:44

In 2008, the federal and provincial governments each gave nearly $20 million to the company, which was also expected to put in $20 million, to upgrade the railway. Omnitrax signed a contract, obtained by CBC News through freedom of information laws, agreeing to assume full responsibility for the operation, maintenance and repair of the rail line until October 2018.

If the company discontinues or abandons the rail line or port, Ottawa is entitled to have the funding returned, according to the contract.

The Port of Churchill was closed in August 2016 with little warning. After a winter of blizzards and a spring of severe flooding, sections of the rail line to Churchill washed out, leaving it without a ground transport connection.

Omnitrax can't afford repair

In July, Prime Minister Justin Trudeau said Omnitrax has a legal obligation to fix the line, but at the time, stopped short of threatening legal action.

Omnitrax has said it won't pay to repair the tracks. A report prepared for the company by engineering consultants AECOM concluded that essential repairs would cost approximately $43.5 million. That report, prepared in August, included a 60-day plan to restore rail service by early November.

Tweed said after receiving the report he let stakeholders and the government know that Omnitrax would not be in a position financially to repair or continue operating the line.

Omnitrax previously told CBC News that the situation amounted to a force majeure — a legal term referring to unforeseeable circumstances that excuse a party from fulfilling a contract — and the company can't fulfil its contract with the federal government.

Tweed added he was hoping for a negotiated sale to a First Nations coalition — between the consortiums Missinippi Rail and One North which recently signed an agreement to buy the rail line — but "based on Transport Canada's actions today, [Omnitrax is] now contemplating steps to bring this protracted matter to a close."

The Government of Canada will continue to meet with key stakeholders and buyers interested in acquiring the rail line, Carr said in the statement.

In the coming weeks, the country's chief negotiator will continue to facilitate discussions between all parties, including the new partnership, Carr said.

"While the Government of Canada remains committed and focused on restoring rail service and the transfer of ownership, we are also preparing for the challenges that may lie ahead," Carr said in the statement.

'Let's take them to task': Churchill's mayor

Since the rail line was closed, food prices have soared and businesses have been forced to lay off staff as goods and materials usually shipped by freight are flown into the community at a much higher cost.

Churchill Mayor Mike Spence said the community was hoping they could still negotiate a way to get the repairs done before winter puts a halt to any progress — but he now thinks that's very unlikely.

"Canada has indicated that it's clear that Omnitrax is not going to fulfil its obligation, so we are at that point," Spence said.

"It's disappointing that the rail line probably will not be repaired before, so let's get on with it. Let's take them to task."

Instead of waiting on Omnitrax, Spence said he hopes Ottawa will start preparing to fix the rail line, likely next spring, and create a long-term solution for its maintenance through the consortium's purchase.

"We have an ownership model. It's time to change the ownership. We have to basically work on that now," Spence said.

The community also has their work cut out for them in terms of food security and petroleum costs, he said. He's hopeful Carr's trip north next week will help solidify Churchill's role in the federal government's Arctic sovereignty plans.

"We see that as very clearly that the federal government is getting serious about Churchill," he said.