Turning around a track definitely dissipates some heat energy through increased friction with the rails. Imagine taking a semicircle turn and making it tighter and tighter. At the limit, the train is basically hitting a solid wall and rebounding in the other direction, which would certainly transfer some energy.

The energy question is this: going from a 100kmh-due-north momentum to a 100kmh-due-south momentum via slowing, stopping, and accelerating again clearly takes energy. You can also switch the momentum vector by driving in a semicircle. Turning around a semicircle takes some energy, but how much - and where does it come from? Does it depend on how tight the circle is - or does that just spread it out over a wider time/distance? If you had an electric train with zero loss from battery to wheels, and you needed to get it from going north to going south, what would be the most efficient way to do it?

There is no "required" energy to change direction, even for a zero-radius change, think of a bouncing ball:

https://www.youtube.com/watch?v=QpuCtzdvix4

This only applies in perfectly elastic systems, where the bodies can convert kinetic energy to potential energy and back with perfect restitution. Which, thanks to the second law of thermodynamics, doesn't exist in reality. It's only a question of how much energy is lost. (Unless, of course, you include the medium into which the energy dissipates as heat into the system itself. But such a model is not useful in almost all practical scenarios.)

A bouncing ball is elastic. There is some loss in the process of storing the energy from the movement into the ball and then releasing it into the opposite direction. Good example though!

> Turning around a track definitely dissipates some heat energy through increased friction with the rails.

No it doesn't, but we're talking about identical spherical frictionless trains in a vacuum.

You are also talking about a track with infinite mass because otherwise the reason train can change direction is because it's pushing the track northwards

Obviously! It goes without saying that the track must be infinitely massive and infinitely stiff, mounted on an entirely inflexible infinite plane.

See, now you're talking real physics!