I installed a FollowMe Tandem - Parent-Child Bicycle Coupling https://www.amazon.com/dp/B007ABVE4I/ref=cm_sw_r_cp_api_i_WAJ02XX6G9ZEYFQ3X8BR on my Larry vs Harry cargo bike. My elder daughter is now 10 and has been riding a 26” two wheeler for a few years but her stamina is still building for anything more than 6 miles. I love the FollowMe because it keeps her pedaling if she wants, and also it takes only a minute to take on and off. We use it for morning bike to school every morning as well.
If it's just 1 child, maybe getting one of these https://www.amazon.com/followme-FollowmeTandemkupplung-FollowMe-Drawbar-Bicycles/dp/B007ABVE4I?th=1 to tow them behind you until you get to the safer road.
Haven't tried it myself, but considering a similar solution.