Here's how i would do it:
things would work differently for each "good" according to 3 differences:
1) The planet/tradepost deciding whether a route is used or not:
It's either the destination or the departure-point/colony;
some goods would use both but honestly these would be more realistic then fun.
2)Distance allowed and price-bias.
Preferably this is done so that the player can easily see distances on the map and therefor i 've kept it out of the formula,
i also assume an economy that grows or at least changes over time.
Most goods would be divided into 3 rangecategories (short-range, med-range, long range),
and tradeposts would sell(or buy) the first X of a good only short-range, but above X they would try to sell a certain percentage med-range and only if there is no-one transporting med-range sell short-range.
(Cheaper/shorter routes are considered cheaper only compared to other routes in the same range-cateory.)
3) The way of deciding which route and competitor is used.
(first the route is decided, and only with multiple competitors on that route is there the a likewise check for them)
This should be decided by a (combining up to 100%-)formula combining up to three main considerations and (influenced)random:
a) Who brought the resources required to build the goods in the first place ?
The competitor who brought the goods should only get a modest reward(like 10%) since this reward would accumulate over time(see point 2) (for example iron ore to build steel or steel to build tanks)
bThe route or competitor who brought the goods the settlement required/used last turn.
For example teddybears who have no other requirements, however most goods would have their formulas filled up with this value, so it would take some time to push a competitor out of a route.
c)The route end-products went last turn, this would go for for example for for the destination-route of gold being used by (only the) departure-colony of jewelry to decide which route(or competitor) would be used to transport/sell jewlery.
I suppose passengers should be a specific case here as they could go both ways on a route and thus mechanically can be used as a marketing-tool for themselves
d)random and quality/pricing:There should be a small percentage of tranportable goods that will just look at all the the available routes and make a decision based on randomness, advertising could increase this percentage at the expense of other competitors, however this randomness is modified by quality(if your game has something like that) and which route is cheaper.(at the same range-distance)
That was it, i 've btw only assumed that trade-posts want to buy or sell a good, and not that they're actually offering a price,
which would complicate things a lot and maybe for some more sophistication.
Additionally i would allow players to use multi-usable or refittable cargo-ships that can transport different goods so they don't get stuck in a short 1-good-route.