This is just one of the many little frustrating things modern life is made of. You may arrive first at the train station and wait for the longest time. But you don’t know where the train doors are going to open, which might cause people coming later to get inside before you and grab a better seat.
On really bad days, you might even find yourself standing during the entire commute, while people who got to the platform after you, are sitting down. But don’t take it so badly – every day is different. Don’t forget all the times when you arrived at the station at the very last minute and managed to get on the train in perfect timing. We win some, we lose some.