Scarcity determines value. The rarest of trains can be worth tens of thousands of dollars. Brand names count. Lionel is the most collectible, followed by American Flyer and Marx . Original price plays a large part in determining value.
Condition means everything.
An old Lionel train that looks great but won't run is worth more than the same train in scruffy condition that runs like a Swiss watch. Having the original box the train came in can add tremendously to the train's value - even if the box has seen better days. Original instruction sheets also help. The more original parts the train has, the higher its value will be.