When you build a trade post on a resource with a trade unit, a trail is automatically built on the plot. But if the plot already had a route, it is replaced by the trail.
In PAE_Unit.rpy, in doBuildHandelsposten function, you can check if a road already exists:
if pPlot.getRouteType() ==...