While the caravan/cargo ship does have a graphic that goes back and forth, the trade route gives food/production/gold per turn, not per graphical trip.
I just tested the effects of distance in my current game (all routes comes from the same port city).
Internal cities:
I sent 2 cargo ships to cities in my own empire:
- City 1 is 10 hexes away, the trade route gives 9 production/turn, for 30 turns.
- City 2 is 21 hexes away, the trade route gives 9 production/turn, for 30 turns.
So, distance does not effect how long internal trade routes lasts, or how much food/production you get (from what I can see).
Foreign Cities:
I tested it with some cargo ships to foreign cities and city states:
- City 3 is 28 hexes away (other civ), trade route lasts 28 turns
- City 4 is 29 hexes away (city state), trade route lasts 29 turns
- City 5 is 40 hexes away (city state), trade route lasts 40 turns
- City 6 is 42 hexes away (city state), trade route lasts 42 turns
It does effect the length of time that a foreign trade route remains active, the trade route appears to last 1 turn per hex of the trade route length.
Distance does not appear to influence the calculation of gold/turn with foreign cities. Based on the trade screen, that is related to "difference in resources", and the two cities local gold/turn generation.
Defence:
Distance will be a consideration in the defence of trade routes, because if a trade route is very long you will have more distance to protect from barbarians or enemies.