Because another train might pass in the other direction at that exact same moment. Which can be downright terrifying, in case you were wondering. Odd, isn't it? I always thought sticking your head out the window of a moving train just as another train passes in the other direction wouldn't be much of a big deal. Lesson learned.