ALBANY, N.Y. — A judge has ruled against New York state’s plans to turn a 34-mile-long section of an Adirondack railroad into a multi-use trail.

A state Supreme Court justice in Franklin County ruled Wednesday that the Cuomo administration’s plan was “arbitrary and capricious” and failed to follow numerous state laws.

The state’s plan called for removing the rails between Tupper Lake and Lake Placid for a trail corridor that could be used by hikers, bicyclists, snowmobilers and cross-country skiers.

The plan was opposed by the Adirondack Rail Preservation Society, which operates tourist trains as the Adirondack Scenic Railroad.

The justice’s ruling was in response to a lawsuit the organization filed against the state last year.

State officials say they’re reviewing the decision.

The state’s plan for the 119-mile rail corridor from Utica to Lake Placid was finalized after many years of contentious debate.