Controlling model tram

You could just use some relays for that.