By default, trains with roboport equipment in their grids only deploy robots in manual mode, this mod makes all trains deploy robots, also in automatic mode.
Note that robots will still obey the "Enable logistics while moving" checkbox in the equipment configuration. You probably want that disabled since the train can easily leave the robots behind otherwise.
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.
Note: in vanilla Factorio you cannot equip trains with a roboport equipment, you need a mod for that.
Details: this mod sets
entity.allow_robot_dispatch_in_automatic_mode = true
for locomotives and cargo wagons.