This definitely is a way to ctb and I've seen people mentioning it multiple times. My problems with it are how traumatised this can make the innocent train driver be or if your loved ones, even after your death, wanted to seek closure, they might only be able to see the disfigured body.
Overall, I respect people's methods of choice as long as they don't negatively involve/harm/impact other people (this excludes shock and devastation after death).