A Quebec judge has rejected Canadian Pacific Railway's challenge of a court settlement aimed at compensating residents of Lac-Mégantic.

About 25 companies accused of responsibility in the 2013 train tragedy that killed 47 people have contributed to a compensation fund of $431.5 million.

The settlement was being opposed by Canadian Pacific.

The company wanted Superior Court Justice Gaetan Dumas to rule that the settlement fund was unfair because it would have limited the railway company's ability to countersue other firms involved in the tragedy.

CP also wanted the judge to declare the ongoing bankruptcy proceedings for the railway responsible for the disaster — Montreal Maine and Atlantic Railway Ltd. — illegitimate.

In his ruling Monday, Dumas stated that Superior Court has legitimate jurisdiction and that the settlement process to compensate victims can go ahead.

A spokesman for Canadian Pacific told CBC News that his company is reviewing the judge's decision and has no further comment at this time.

Settlement package

Much of Lac-Mégantic's downtown area was destroyed when an unattended train with dozens of oil-tanker cars derailed on July 6, 2013.

Canadian Pacific Railway is the only company named in the class-action lawsuit that has refused to pay into the compensation fund.

Families of victims of the Lac-Mégantic train disaster involved in the lawsuit voted unanimously in favour of the settlement package in June.

Some of the money will be distributed among the families of the 47 victims of the disaster, as well as the family of a firefighter who committed suicide shortly afterward, according to the legal team representing the claimants.

They will receive anywhere between $400,000 to $5 million, depending on the family situation.

A spokesman for CP said in June the company believes the victims of the derailment deserve compensation, but says CP is not responsible for what happened.