The order was imposed in June after the youngster begged doctors and social workers to keep the information secret.
Mr Justice Hayden ruled that the ban should stay in place after a High Court hearing on Tuesday.
Council lawyers – who admitted the order was unusual – asked him to keep the ban in accordance with the girl's wishes.
The girl lives with another family member, and has been estranged from her mum for several years.
Her dad is aware of the cancer, but she is "adamant" that the woman should know nothing.
Mr Justice Hayden ruled that council staff should not tell the mum anything – and released teachers from her school from obligations to pass anything on.
He was told that hospital bosses had decided not to give out any information against her wishes.
The judge said he took into account the woman's parental rights and her daughter's right to privacy.