No, he wasn't thinking of himself, but he damn well wasn't thinking about his family to be either. I bet his unborn child will be happy to know dad died for a f**king dog.
He probably wasn't thinking at all. He saw his beloved dog on the tracks and rushed to save him. I recently hit the brakes to save a damn squirrel and the car almost went out of control. It was a reflex on my part. And as an owner of a black lab, those damn dogs have a knack of ending up where they shouldn't be.