There are two switches for the two Y-points in the trolley tracks. That doesn't make it any easier, since you have to flip the switches in order to switch the trollies.
However, you can reach the switches from the trolley tracks, so if you follow the trolley down (don't climb on it, just run after it), you can switch the tracks yourself without having to go all the way through and back. That's how Missy did it in her last adventure, largely because I get tired of running back and forth over the same ground.
One hint: before getting started, create a portal at the starting point for the two trolleys. If you get stuck anywhere, you can just teleport back to it. Beats the heck out of reloading, let me tell you...