LAC-MEGANTIC, Que. -- The Quebec town that was devastated in 2013 when a runaway train derailed and exploded, killing 47 people, will not pursue legal action against Canadian Pacific Railway.

Lac-Megantic's city council voted Tuesday evening to drop all possible charges against the railroad.

Mayor Jean-Guy Cloutier said it would cost considerable sums of money to pay for experts over several years and that there is no guarantee the town would win.

"There are many reasons for this decision," Cloutier said in a statement. "We thought long and hard about it and reached the conclusion the risks of such action were too high in terms of the costs to the community."

The train that exploded in the town on July 6, 2013, was owned and operated by Montreal, Maine and Atlantic Railway -- not CP --as were the tracks on which the locomotive was travelling.

Canadian Pacific (TSX:CP), however, owned the tracks on which MMA's train began its journey from North Dakota. When the train arrived in Montreal, it switched onto MMA tracks to complete its scheduled journey to New Brunswick.

Victims and creditors of the disaster blame MMA but also CP, which they claim acted negligently in a number of areas.

CP is the only company accused of responsibility in the derailment that has not paid into a settlement fund.

More than $400 million has been collected from roughly 25 companies accused in the crash. All of them -- except MMA -- received legal immunity from future prosecutions relating to the derailment.

CP maintains it had nothing to do with the disaster because the crash occurred on MMA tracks involving MMA trains.

The Quebec government has launched a $409-million lawsuit against CP and a class action lawsuit against the railroad has been authorized to proceed.

For Lac-Megantic, however, its legal case against CP is over.

"We would be obliged to spend considerable sums on experts over several years," Cloutier explained. "And there is no guarantee we would win. We find the process long, complex and very costly. We can't put this burden on the shoulders of Lac-Megantic residents."