
My current idea is this: Introduce train-logistics.
Similarity to the Logistic-System (with robots)
Logistics for the robots works currently so, that the logistic-system looks for the requested and provided items and creates orders out of that. The orders are in a order queue. The orders are then assigned to a free robots.
Train-logistics should work similar. First I show my bad drawings-talent: Well, this is not the Yellow submarine. The truth is: It's just really ugly.

Requester-train-stop
This is just another type of train-stop. It's able to read the request-signals from a circuit and forward them into the train-logistics (which is not visible in this picture, cause it's something virtual - you can compare it with the logistic network). The signals are then taken as "item-request for this train stop", just like a requester chest does this in a logistic network.
Request-Combinator
A new type of combinator, which is able to read all current open requests (from requester chests) in this logistic network, including the requests from ghosts, that have no item to be built. A request is in that case positive, a surplus (provider chests/storage chests) is negative. That is useful, if you want to have default number of items:
You can add a constant combinator to add some default requests, like "this network should have always 100 repair packs available". The constant combinator sends +100 repair-packs, and that is signaled to the Requester-train-stop until the Request-Combinator sends a signal of -100 repair packs which is added 0 (which means, there are no requestes any more).
Provider-train-stop
Like the requester-train-stop this train-stop is able to read the providing-signal from a circuit network and forwards it into the train-logistics as "offer". In this case the offer is just the summed up content of the chests that can fill the wagons.
If there is both - a request and an offer - the train-logistic will queue a train-order.
Train-Ports
That is just another type of train-stop. Trains without order will wait here for new orders. Each train-port can be set to one or more items - that works like a filter: Only trains, that are able to transport exactly the same item-types as specified in the train-port can be directed by the train-logistics to such a train-port.
Wagons and Locomotive
A train can receive orders from the train-logistics. How? I think to a third position of the manual/auto-switch: train-logistics (or it is a special locomotive or the loco is equipped with a special train-logistics-module). In that case the schedule of such a train cannot be controlled by the player, it is controlled by the train-logistics only (when turned into automatic mode).
The wagons need not to be special, but the player needs to set a filter on each stack in the wagon! (A better interface for setting up many filters is a prerequisite for this, there are already mods, that can do this.)
Step by step
So, assumed a requester-train-stop requests 100 repair-packs and a provider-train-stop, that provides that packs. As said this would create an order in a queue.
For this order the train-logistic will now search a train, that is able to transport that order of 100 repair-packs.
It searches therefore all train-ports for repair-pack-filters. If found it searches for trains, that are on the way to that train-port or are waiting in front of it (a bit more complex than this). One of that trains is then given a new schedule: Drive to the Provider-train-stop, that provides the repair packs and wait, until minimum 100 repair are loaded into the train (or wait 2; then drive to the Requester-train-stop and unload the repair-packs or wait some seconds; then drive to the matching Train-port and delete this schedule.
Edit: I just want to mention here, that if a train has it's order and will be filled, with the needed item, the number of filled items are subtracted from the current request of the requester station. This is just exactly as with the logistic network currently.
Wagon-Filters define their purpose?
I think I need to explain this need for filtering a bit deeper.
The problem is, that if a train would be able to transport any kind of item is, that we need a fourth kind of train-stop: A storage-train-stop. A train needs to drive to this train-stop, if he has finished his order, but meanwhile the requesting train-stop doesn't need so much items anymore (for whatever reason). In this case we need to unload the remaining items somehow, cause if we would not do that, the wagons could contain more and more garbage and the train-logistic would fail.
So why not adding such a type of station? Cause that is not fun. I can say that, cause I have made some tests with quite big train-systems and there is no added fun, if you always make sure that the non-empty trains will empty.
It is also much more interesting, if you need to think about how many trains of each type you need and this slight difference to the logistic network enables players to understand the usages of storage chests etc. much better than yet.
So if you want to transport iron ore you need to set up a train with any length and set all wagons stack-filters to iron-ore. The train then can only transport iron-ore.
If you want to have a supply-train, you can set up the wagons so, that the filters include repair-packs, walls, ammo, lasers etc. etc.
What is with the train-stations? How are the trains filled/cleared then?
That is the problem of the player.

Filling: Add (requester-)chests for each type of item and insert them into that train until full.
Clearing: Takes out the requested items until empty or number of requested items is requests is reached (smart inserters).
This suggestion enables only basic operations: Creating dynamic schedules between train-stops by fulfilling requests.
For more clever operations there is much headroom from improvements. For example: Circuit network could be enabled to read the order of the current train (how much items should he bring?). That would enable to fill the train only to the needed values.
And then?
I think it would also be possible to have "multi-purpose-trains". Trains, that don't need to be fixed to some item-types by setting the filters of the wagons. But that is just a very different story and before that can be thought about the simple version (this suggestion) should work.