There's a few different ways of looking at this, so to speak
Movies that feature trains almost as a character, or at least they are the subject of the movie.
Then there's movies that have a significant or key train component, like
3:10 to Yuma,
The Fugitive (Harrison Ford's Dr Kimble's escape is facilitated by a crash at a crossing).
Then there's movies that just have trains in them, either as scenery, or as "everyday life". The latter would include many of the movies made up until the 1950s, where trains - especially passenger - were simply a part of life.
One of my favourite movies that features trains, but isn't really about them
per se is
The Station Agent.
Andrew