A consultation on whether Chesterfield should be part of the Sheffield City Region was unlawful and unfair, the High Court has ruled.
Only residents in the city region were consulted during the public devolution survey between 1 July to 12 August.
Derbyshire County Council said 6,900 town residents opposed the plans. It took legal action in September.
After the ruling, Justice Ouseley said "something had gone seriously and significantly wrong".
If the devolution deal goes ahead, local leaders in the city region would get significant power and an additional £900m funding in exchange for creating a Mayoral Combined Authority.
An elected mayor for South Yorkshire - yet to be elected - would also be responsible for key services in Chesterfield, including skills for employment and major planning and investment projects.
The county council said the people of Chesterfield were not properly informed about the risks and downsides of joining the city region.
Mr Ouseley ruled the consultation failed to ask Chesterfield residents a direct question about whether or not they believed the town should become part of the city region.
He also stated those in favour of the city region had provided no reasonable justification "as to why it had not included such an obvious and fundamental question in the questionnaire".
Anne Western, leader of the county council, said the outcome of the judicial review was "a victory for fairness and common sense".
"The people of Chesterfield knew this consultation was unfair and misleading and this High Court judgment confirms that," she said.
"Thousands of local people - despite not being able to answer the question they wanted to in the official consultation - spoke up and made their views known loudly and clearly."
In a statement, the Sheffield City Region (SCR) said: "The judgement raised the need to carry out further consultation to address the proposed governance changes in Chesterfield."
Chesterfield could still merge with SCR depending on the new results and the process for electing a mayor will now be delayed.