Tested in creative with a loco, anchor, 4 tank carts and diamond and gates. I had to use some spacing with the load/unload blocks due to the spacing of the linked carts. Since I just hooked Void waterproof pipes to the unloads, I just put the gates next them and sent a different pipe signal for each one detecting when there is liquid in the tank. That made it easy to check each was unloading. On further thought you can probably just use iron gates detecting if the unload has work turning on a red pipe. That way they all have to be finished before the red pipe goes low, and you can setup as many as you want. At the train lockdown set the gate to emit a redstone signal when the redpipe is off.