Buckinghamshire County Council is set to go ahead with closing more than half of its Sure Start children's centres in September this year, following the judicial review ruling - believed to be the only case of its kind.
The judge rejected the claim on all grounds, which included accusations that the decision had been made before the consultation ended, and a breach of the county's duty to ensure there are sufficient childcare services across Buckinghamshire.
Campaigners are now considering an appeal, according to James Betts, a solicitor at law firm Irwin Mitchell, which brought the case.
Following a public consultation in 2018, the council announced in March that it was restructuring provision from September, as part of a drive to save money in the face of budget cuts.
The number of children's centres in Buckinghamshire will be cut from 35 to 14 and the remaining buildings will become family centres and focus on children and young people up to the age of 19, rather than to age five as they are currently.
- Opinion: New vision for children's centres is top priority
- Analysis: Deprived councils bear brunt of decline in children's centres use
- Analysis: Positive action to cut childhood obesity
The judicial review was launched after a mother raised concerns over the decision to close Millbrook Children's Centre in High Wycombe, attended by her child.
Two other options considered in the consultation were to keep all the children's centres open or scrap them entirely in favour of targeted outreach services.
In a ruling published on 12 July, Mrs Justice Andrews, who heard the case earlier this month, said she was satisfied that the consultation had been fair.
In her ruling relating to a claimed breach of the Childcare Act 2006, she said: "I am satisfied that the material before the court is sufficient to establish that the council did assess the overall needs and locally based needs of families with young children, and of the children themselves, for children's centres; and that it did make a conscious and informed decision that the 16 centres at the selected locations would be enough to meet those needs."
The judge added: "I am satisfied that the council carried out a fair consultation before it made the cecision; it took the responses properly into account, and it complied with all its relevant statutory duties.
"This claim for judicial review must therefore be dismissed."
However, campaigners have vowed to continue fighting for children's centres which they believe provide a "lifeline" for children and families.
The mother behind the claim, who asked to remain anonymous, said: "At least our voices were heard and that I tried my best to do good not just for the children centre's but for the whole community.
"I am considering whether to appeal the decision and am still hopeful we could save our children's centres."
Alka Dass, of the Save Bucks Children's Centres campaign, urged other people worried about closures to lobby their MPs, adding that a date for a national parent led march will be announced soon.
"I urge everyone to start banging the doors of their MP's locally and nationally - phone their offices, meet them personally, write to them.
"Giving up is not the solution.
"Early intervention is key, and children's centres are a lifeline."
In May, it was announced that charity Action for Children had won the £5.2 million a year contract to run children's centres in Norfolk, which are being cut from 53 to 15.
This followed the county council's decision to reconfigure provision via a new Early Childhood and Family Service.
Warren Whyte, the council's cabinet member for children's services, welcomed the court ruling, and criticised campaigners for mounting the costly challenge.
"It is regrettable, however, that we have had to contest it at all, as this has been a very costly process - both financially and in terms of the time spent by our team in preparing for this hearing," said White.
"These proceedings have caused anxiety for our staff and critically, could have shifted focus and energy away from the children and families who need our support."
Whyte also defended the council's plans, claiming that services were not being withdrawn.
"Quite the opposite; it's about enhancing how we help families across Buckinghamshire with children of all ages.
"People who need extra support will be able to get it in a more targeted way under the new Family Support Service."
Earlier this year, the Department for Education announced it was reviewing children's centres and other delivery models to find out "what works well".