The man was trespassing on the railroad tracks when he was hit, Union Pacific said in a prepared statement.