I think that you may be confusing the timing of individual legs of the journey with the timing of the journey as a whole. The routes taken by goods are calculated using the timings which are displayed in each stop's details window.

To give a very simple example of goods trying to get from A to B, imagine that stop A's details window contained the following information:

Journey to B: 1 hour travelling, 2 hours waiting

Journey to C: 1:30 hour travelling, 5 minutes waiting

And C's details window contained the following information

Journey to A: 1:30 hour travelling, 5 minutes waiting

Journey to B: 30 minutes travelling, 10 minutes waiting

the goods would go from A to B via C because 1:30 hours + 5 minutes + 30 minutes + 10 minutes is less than 1 hour + 2 hours.