Controlling model tram

Definitely not a toy train type. Did think about adding another sensor at the entrance to a station which would trigger a stepdown of the current with the power going to zero for a precise stop at the stop sensor.

And yes, this is DC, no digital stuff.

Reason for reducing 298N is that in my full loop model I might end up needing three of them in one circuit, with six sets of outputs, with 12 sensors and eight signals. I'm concerned I won't have enough pins even on a Mega!

Is there an advanced H-bridge, beyond a 298N, that can handle more than two motor outputs without the need for multiple 298N?