One of the 'tutorial game' is indeed to move resources. I think a lot can be done if the train exposes variable and counters (ie.: the colour blocks become resources, the train starts counting them, and you can write if-then-else logic around it)
There is a Scratch extension using Scratch Link to communicate with the train, so you can definitely build a program using counters and variables. See https://scratch.intelino.com/