The pupils were excluded from the Yorkshire Martyrs Collegiate School in Bradford, in January, after one of them brought the weapon and pellets into the school to sell it.
The decision by the head John Clarke was backed by governors. But parents of one of the boys appealed against the exclusion and won.
The decision to overturn the head's ruling has been defended by Colin Powell, a Tory councillor and member of the appeals panel.
"It was thought that the two-month exclusion was sufficient punishment for what had happened," he said. "It was hardly likely to happen again. The gun has been destroyed. The pupils there are as safe as they would be at any school. "
The boys were due to return for the start of the new term on Wednesday, but are now expected to remain at home until the dispute is settled.
As The TES went to press, talks were continuing between the boys' parents, the head, the chair of governors and local education officals to resolve the deadlock.
Members of the National Association of Schoolmasters Union of Women Teachers had voted by 39 to 3 not to teach the boys if they returned to school.
Brian Garvey, spokesman for the NASUWT, said: "What the appeals panel is saying is that it's OK for pupils to bring guns into school."