The boys have been taught in "isolation" since the start of the new term at Mount Carmel Roman Catholic High School in Accrington, Lancashire a month ago.
A relative of one of the children told the Lancashire Evening Telegraph that the decision to ban them was "pure discrimination".
"Because these boys cannot shave their beards for religious reasons, they are being put in isolation for six-and -a-half hours every day," the family member, who did not wish to be named, said.
"They are not being allowed to mix with anybody or speak to friends. It is pure discrimination.
"They chose that school because it is within their area and has good results. The school has to have an open policy and they have to take in people from all religions," the family member said.
The matter seems to have been complicated by the fact that two other boys were allowed to keep their beards towards the end of last year as their secondary education exams approached but that was as an "exception" because the school did not want to place them under "unfair pressure".
Head teacher Xavier Bowers said boys had that situation explained to them and were told they must return from the summer clean shaven, and he insisted that the matter was one of dress code, not religion.
"We have not taken this decision lightly," Bowers said.
"I have spent quite a lot of time researching the issue and speaking to Muslim elders. There is nothing specifically written in the Quran about wearing a beard. It is a choice those boys are making. However inclusive we are, we have standards to maintain," he said.
Bowers today issued a further statement via Lancashire County Council in which it seemed the school was not backing down from its stance.
It is understood the families of the two boys and the school are in talks to resolve the issue.