Judge upholds appeal by woman from member of borough's Hasidic community who says her son was denied an adequate secular education