The question is if you're willing to run it conventional DC (vs. conventional AC). PS3 can do either. You lose bell and whistle if operating conventional DC...but it is pretty simply to reverse DC polarity on the track. If you run AC conventional, I think the issue is how you know with certainty which direction you're going when you interrupt track voltage to toggle the direction.
Another issue is if you want the trolley to wait for 10 seconds (or whatever) at each end before heading back the other way. I'm sure you've seen the bump-n-go trolleys that slam into each track end and instantly reverse direction without stopping to let the passengers unload and load. The nice thing about AC conventional is the defined neutral position where track voltage is present but the engine is stopped (lights work, sounds work, etc.). It's a little more interesting with DC operation but you can do it with PS2 or PS3 because there is a defined (albeit small) DC voltage window where the motor is stopped (like AC conventional neutral) but the lights and sounds should still function. So with low-cost (99 cent) eBay DC regulator modules, I think you could cobble together something that makes sense. The trolley could drop the DC track voltage to 0 speed but still have the lights and sound operation. A dual-coil latching DC relay would reverse DC-track-voltage polarity using a $2 DPDT relay triggered by a pair of 50 cent micro-switches (1 on each end of track) or a 10 cent magnet on trolley triggering a pair of 25 cent reed switch on each end of track. $2 time-delay modules could keep the trolley stopped for some number of seconds before heading back. You could even ramp up/down or step up/down the DC voltage so the trolley slows down as it reaches each end, and gently accelerates rather than jack-rabbiting when starting the other direction. Endless possibilities.
Of course, as suggested by others, there are suppliers that have a variety of back-and-forth trolley solutions - like Dallee for, say, $50 and up. I'm partial to the DIY roll-your-own approach as that's what makes the hobby fun for me plus you can save some money.