É mais provável que o Expresso de Hogwarts seja considerado uma extensão da própria Hogwarts. Esta seria a única razão pela qual a Magia dos Menores é realizada a bordo sem penalidade.
There have also been examples of underage magic being performed aboard
the Hogwarts Express without penalty, perhaps suggesting the train is
considered an extension of the school grounds (such as when Ginny
Weasley used the Scouring Charm to clean up a compartment following a
mishap with one of Neville Longbottom's plants.
Order of the Phoenix (Scourging Charm use on the train)
Existem alguns exemplos de magia sendo realizada a bordo antes de chegar à escola.
Agora, de acordo com a wikia, o Expresso de Hogwarts foi especificamente usado para transportar crianças sem suspeita usando um feitiço de ocultação (que impede a detecção de trouxas).
Sometime in between 1819 and 1849, Ottaline Gambol rose to the office
of Minister for Magic, and she made a daring and controversial
suggestion to solve the ages-old problem of how to transport hundreds
of students to and from Hogwarts Castle every school year without
attracting the Muggles' attention: intrigued by the Muggle technology,
the Minister saw the potential of using a train as a secure and
comfortable alternative to Portkeys or to unregulated means of travel.
The Ministry of Magic conducted a a large-scale operation involving
one hundred and sixty-seven Memory Charms, as well as the biggest
Concealment Charm ever performed in Britain, in order to acquire the
locomotive. The morning after this operation, the residents of
Hogsmeade awoke to find the gleaming red Hogwarts Express and a
railway station that had not been there previously, and the Muggle
railway employees in Crewe had the feeling they had misplaced
something, which stayed with them for the rest of the year. There
was initial resistance from pure-blood families against using a
Muggle-built device for wizard transportation (which, they claimed,
was "unsafe, insanitary and demeaning"), until the Ministry decreed
that students would arrive to school on the train or not attend at
all.
Source : Pottermore information on the Hogwarts Express
Isso permite o transporte seguro de estudantes para Hogwarts, e eu também acredito que eles podem lançar magia sem penalidade devido ao extremamente grande Feitiço de Ocultação (os trouxas não seriam capazes de testemunhar quaisquer atos de magia e os estudantes geralmente evite fazer feitiços perigosos a bordo também na maior parte).