Thanks for bringing this up, Diane. I'll try to add to Mikaela and goadra's excellent observations. The thing I think of first with the railroad tracks is the beginning and end of a journey. The story is like a journey, and the actors wind up in a far different place than where they started. On another level, trains are an icon in the West because they tamed the West and made it possible for people to come in and populate it and "civilize" it. Trains bisected towns and whole areas of the country and brought divisiveness so that you had to be from the right side of the tracks and never go to the wrong side of the tracks. I talk about this more in the subject "Broken in Two" on Chez Tremblay. On yet anohter level, there are two tracks which are forever joined, so the train tracks are a symbol speaking of the duality of Jack and Ennis.
The way I interpret the beginning view when we see Ennis through the gaps in a passing train is an alternating dark and light scene, which introduces the theme of yin and yang, the opposite and complementary forces of dark and light, noisy and quiet, etc. that will work upon Ennis and Jack throughout the film.