Hopes have been raised that the changes to services in Calderdale and Huddersfield could be halted after a hearing at the High Court in Leeds.
The plan would see Huddersfield Royal Infirmary (HRI) knocked down and replaced with a smaller site.
A&E services would be centralised in Halifax under the proposals, which have raised safety fears over longer journey times to hospital.
There were cheers in court as His Honour Judge Gosnell ruled in favour of a judicial review on five out of eight grounds put forward by the campaigners.
Jenni Richards QC, acting on their behalf, argued that a Full Business Case report drawn up by Calderdale and Huddersfield NHS Foundation Trust was flawed and did not properly take into account the safety concerns raised during a public consultation.
Among the fears raised were extended journey times to A&E and the welfare of children being transferred between hospitals.
Referring to travel times, Ms Richards said: “There is no reference to it in the Full Business Case.”
The hospital trust argued that the changes are in the best interests of patients and the way services are currently organised is not sustainable.
Jeremy Hyam QC, for the trust, said a judicial review was not necessary because the proposals had been subject to an independent review, with health secretary Jeremy Hunt expected to make a final decision.
He said: “Delay in this case caused by judicial review pushing back the approval process is not in the best interests of the local population.”
Mr Hyam said that a travel analysis had been carried out by Calderdale and Greater Huddersfield Clinical Commissioning Groups (CCGs), which control the local health budget.
But delivering his ruling, Judge Gosnell said: “It doesn’t seem to me that this was considered fully, or indeed significantly, in the business case at all.”
The ruling reverses an earlier decision to refuse a full judicial review and means a judge will decide on the legality of the decision making behind the hospital changes.
Speaking after the hearing Cristina George, of action group Hands off HRI, said: “I’m delighted. I’m thrilled. I think it’s the beginning of a journey, but at least there’s some recognition that what’s been done has not been done it the right way and there’s a case to answer."