Don’t forget also, at least in the UK, they also had hopper wagons which would either tip to one side or have a hatch in the bottom that opened for the open wagons…
Possible solution: Give each wagon/carriage a “load/unload speed”, default value of 1, which is the steps the loading and unloading ticker jumps up or down by per “tick”. In addition, for passengers, you further multiply that by the number of passenger carriages in the train… since those passengers would be getting in and out by multiple doors at a time.
You could, even, limit the number of carriages allowed at any one station by giving each length of platform a maximum value, so the short 160m platform would only allow (for example) 6 carriages, so only 6 would be counted towards helping the ticker speed, any more would be “lost” during that stop for that purpose.
The carriage speed would probably be averaged when you add/remove rolling stock in the depot and the number of carriages would be updated then too, so it wouldn’t require much maths during the actual loading phase, so wouldn’t impact too heavily on the game. A similar system could be used for buses and trams but, obviously, you wouldn’t need a number of carriages, so the number of doors would be the only factor there (the larger articulated buses would be treated as one unit).