By default, trains wit roboport equipment in their grids only deploy robots in manual mode, this mod makes all trains deploy robots, even in automatic mode. Note: in vanilla factorio you cannot equip trains with a roboport equipment, you need a mod for that.
You can use the "Robots Inactive" wait condition so that the train will wait for all robots before moving on. Beware though: if the cargo gets full the robots will just wait floating around outside until there is space to put their cargo and/or themselves.
Details: this mod sets
entity.allow_robot_dispatch_in_automatic_mode = true
for locomotives and cargo wagons.