An inquest has opened into the death of a man who was struck by a train.