TL;DR
A train factory would be a series of factories chained together next to a track that would automatically build overall desired configuration of each car including the schedule.What ?
While we can copy a train setup, we should be able to create a factory that does this overall configuration. Ideally this leverages logistics to determine when to create a train and add it to the track based on train network.This would allow the automated creation of trains dedicated to specific configurations and schedules. After the train is fully created, the schedule is applied.
The same concept can be applied in reverse in that the train can be removed from the train network if there are too many of a given train configuration.
There also could be stations which can reconfigure a train.
The same concept can be applied to other entities that have a grid, logistics, or inventory.