Pathing for trade carts gets pretty wonky. They'll follow the road one way and then take a detour across a mountain on the way back. I'll have them walk next to the road sometimes too, following it just not on it. It would be nice if trade carts (and other agents) had a stronger preference for roads, especially outside the city limits where it may be dangerous to wander.