I have seen in several posts that an antenna should be cut to length dedending on what range of frequencies a person in listening to. What does the length of the antenna have to do with reception? If I am on a hill over looking my town listening to trains for example, does the length of my antenna itself make that much of a difference? And Vice versa, if I was in a valley? What if I were 15 stories up as opposed to ground level?
I have been contemplating getting an antenna for the roof of my single story house to see if I can extend my reception just enough to here a train HotBox detector in the next town. I am currently using an extendable antenna on the scanner. Would putting an antenna on my roof at the proper length really help?
It appears that you're attempting to use two different terms (length and height) as if they're the same thing. They're not the same. User jackj was correct in what he was saying, but if you think that length and height are the same it won't click in your brain.
An antenna length is important and is relative to the desired frequency and antenna design. The length should be what is necessary to cause that antenna to resonate at (or near) the frequency. What length is correct is based on the antenna's design. There are many factors that the design affects. Some of the important ones are gain (amount of signal the antenna will capture and send down to the radio), how wide the resonate frequency band is (some will work from 25 MHz - 1500 MHz while others are only good for a few MHz at a specific frequency), how directional the antenna is (signals from all areas picked up or just those in a single direction), etc.
For example, for a quarter wave antenna (a very common type) that is generally rather low cost, works well but has minimal gain, and is designed for a small range around a single frequency. The length of one on the VHF-Hi band (say 150 MHz) is about 19" long. That same antenna designed for the 800 MHz band would be about 3" long. That very same antenna cut for the US CB band (27 MHz) would be about 108" long. The antenna would work quite well on the band it was designed for, but may not work too well on the other bands.
Antenna height is the height above ground (or some other common measuring point) you place the antenna. Generally, the higher you place an antenna, the more you'll pick up while the lower you place an antenna, the less you'll pick up (there are exceptions based on the antenna design selected and a few other factors). The counter to the "higher the better" rule is the higher you place the antenna, the longer the feedline will need to be. The longer the feedline is, the more loss it will have (also the higher the frequency the more loss) so feedline choice is often more important than which antenna you select.
Remember that it's the antenna system (everything from your radio up to and including the actual antenna) that matters. A great antenna installed poorly, using lossy coax will probably give worse results than an OK antenna installed properly using good grade coax of the proper type. Also note that it's not always the best of everything that will give you the best results, but selecting the right combination of components is often what gives you the best results.
Too much signal can be as much of an issue as too little. Too much signal can cause your radio to be overloaded so the weak signals you want will be worse. These signals may not always be where you might think. Often with scanners a nearby cell phone tower, TV or other broadcast station (I include the NOAA Weather transmitters, paging transmitters, etc. when I say "broadcast"), or even a strong two-way transmitter can cause serious issues and a "great antenna" on that scanner can make things worse, not better. There are things that you can do to work around these issues once you've identified which one (or ones) are your issue.
To help answer your specific question at the end, an antenna resonant at or near the railroad frequencies (that would include nearly all VHF-Hi band antennas) placed on your roof using some good grade coax (LMR-400 for example) could help bring in the desired signals. Don't worry as much about the exact length of the antenna (for VHF-Hi they good ones can be from 19" or so to as long as 20' or more) but having that antenna mounted securely at a good height above your roof can be helpful. The main issues that should worry you (more accurately should factor heavily into your design) are how high the transmitter (the hotbox detector in your case) is and how high you can get your antenna. Since most hotbox detectors are generally rather low your antenna may need to be rather high or even directional (for more gain and less signals you're not interested in) to do what you want.