I think i have faced this situation, but i'm not so sure, there was water cannister maybe was the burnt result in my memory at some point in game.
You can deal with managing the increase in canister number that is necessary to adapt to the increasing number of trains by making sure of 3 things => 1)there is enough empty cannister at the place where they are filled for 1 full train, AND 2)that there is also enough space for 1 full train worth of empty container at the place where they are unload AND 3) that the recently unloaded empty cannister are refilled in priority over the newly made empty cannister.
1) say you have some assembly making "new empty cannister", you wire their output inserter/belt so that it is not producing/ adding more in the system when there is enough empty cannister for 1 full train of buffer. say 500, so that any train that need some cannister for delivery because you just add it for example, will be able to pick up cannister, after those 500 you keep are filled with fuel, the assembly will remake 500 to restore the buffer, increasing the total count of cannister by 500.
2)Then you also need to make sure at the place where you unload the empty cannister, where there is 500 empty in buffer. That there is also enough room to empty 500 more so that in total there would be 1000 waiting to be filled. Otherwise an train filled with empty cannister could get stuck trying to unload and jam the whole system.
3)The last piece of logic is to use some priority to make sure the "recently unloaded empty cannister" are used in priority over the "newly made empty cannister", which can be done with a splitter and priority input lane. This way when you temporarily have 1000 cannister, the factory will use the correct source to refill 500 and leave the other 500 empty as reserve for any new potential train.
Not sure how such logic would be applied with multiple station to refill/empty cannister. But it doesn't need to know how many trains are there to make sure there is enough empty cannister ready and enough room to handle problems.That's not how robotport knows how many robots are in the network, more like connecting inserters to the logistic network so that they keep X cannister in the system at all time and prevent their assembly from working if the limit is reached already.
If for whatever reason the assembly refilling the cannister stop working, then you will have an acumulation of empty cannister due to the unloads and trains will start to queue at the unloading of empty cannister but no new one will be created since there would already be 500 +.
If for whatever reason the assembly that make new empty cannister stop working, then every additionnal trains will wait for cannister, it will only be when another train unload its empty cannister than the additionnal train that was waiting would be allowed to do something, once the cannisters are refilled and it is loaded, and the other train that unloaded them previously will then wait instead because of cannister shortage for yet another train to unload some empty ones.
There shouldn't be a time where too many cannistesr are created that would require more manual intervention than resuming supply of cannister material or fuel to fill them. no need to purge the system of empty cannister. which i understood was the goal but that's also kinda side stepping the challenge you presented at first so not sure if this is a satisfying answer