The older boy has had some vaccinations against disease, and the mother claimed he suffered a persistent cough, eczema and cradle cap as a result.
But the boys' father said the mother was obsessive, over-protective and narrow-minded, and called on the court to order that both children should have routine vaccinations as they grow up.
Judge Rogers's order means the two boys will be given injections against diseases including diphtheria, polio, meningitis, measles, mumps and rubella as they reach the correct age for vaccination.
The judge backed the father's claim that the mother "has a suspicion of conventional medicinal methods" and that she was "even suspicious about the administration of something like Calpol".
The mother told the court: "What I have learned simply is that, yes, vaccines do work some of the time, but there is a definite risk with vaccination. The vaccine manufacturers have cited that vaccines are 'unavoidably unsafe'.
"There is a very rare risk that either of the children will ever catch one of the diseases listed in this report. Both children are thriving and have strong immune systems which definitely helps in protecting them from diseases.
"No vaccine is vegan. No doctor will criticise the actions of a vaccine or he or she will be afraid of losing their job."
She added: "It is not natural to be injected with metal elements and as a vegan it goes against my beliefs for my children to be injected with something that is grown on animal cells or something that has been tested on animals."
Judge Rogers said the mother had tried to get a medical expert to appear in court to support her views but could not find one.
He added: "I have serious concerns as to her ability to look objectively and even-handedly."
In his ruling, made in December but published only yesterday, the judge said the boys should be vaccinated under the terms of the 1989 Children Act, which says the courts can over-rule a parent in a case involving a child's welfare. None of the family has been named.
The ruling follows a test case in 2013 in which High Court judge Justice Theis ordered that two sisters aged 15 and 11 should have the MMR vaccine, even though they and their mother did not want it.