This sounds like people trying to excuse a suicide.
Sometimes in rail yards it's difficult to tell what is a pair of tracks and what is the space between the tracks. At night it's terribly easy to miscalculate and think that a train is going to pass right next to you, when in fact you're actually on the track. Sometimes two trains pass so close together that there is hardly room for a human being, and then you can be knocked down and pushed under the wheels. I was in a railyard once and was shocked at how confusing it is. If this guy was running around in the darkness trying to get his dog he could have very easily made a fatal mistake. No reason to believe it was suicide or that he intended to give his life for a dog; it was probably just a case of someone getting into a situation he didn't anticipate.
Yeah, that's the funny thing. It is hard to imagine an otherwise normal dog would simply sit on a railroad track with a load, rumbling train bearing down on it. Something doesn't add up here in this story. I think you may be right, this is just a plausible story floated to cover up a suicide.
Or maybe the dog was deaf?