Technically it was a train, and they were experiencing a transcendent connection across time with their older selves, in a deliberately unsettling and transgressive scene meant to evoke the rawness of adolescence being laid bare before the worst cosmic horror – an eldritch carrion-eater who feeds on destroying the souls of children – as a way of reclaiming strength from vulnerability. At any rate, depiction is not endorsement.
But yes, considering how many actual adults misinterpret and mischaracterize that scene, I don’t recommend that particular book to children – not because they’ll be damaged by it, but because they won’t have the wisdom of age to understand it.