Because to do neither would suggest a lack of interest in the girl and most guys would want something to come of it. Confident types would stare (probably absolutely convinced that the girl finds the attention flattering) and shy types would look anywhere and everywhere else to overcompensate for the fact that they're trying to make out that they're not interested.
If a guy sat on a train opposite a pretty girl and acted completely normal, the girl would presume he's not interested.
This question reminds me of a time I really made a classic tit of myself on a train. The (very attractive) girl opposite me was asleep. She was clutching her ticket in her hands and I could make out that her destination started with a B. I was concerned that this concealed the word "Banbury", my stop, and the stop we were rapidly approaching. I wanted to make sure she didn't miss her stop. So I gently woke her up and, dumbfounded by such a gorgeous face, announced, "Hey I'm really sorry to wake you, but I wondered if you would be getting off with me." As I said the last few words I screwed my face up, turned on my heels and left.