The judge sided with families of students who had argued that the displays infringed on their religious freedom.