The first alternative raises a host of complications -- should the escorting military units be able to enter foreign territory without open borders and, if so, why does that make sense? Once the escort formation is formed, should the player be able to break the formation mid-route, or not, and however that is answered, how is the formation presented on map? If the escorting military unit crosses paths with another military unit, do they stack, or do they block each other? If Civ A is trying to besiege Civ B's city, and Civ C is sending a trade route to that Civ B city, will Civ C's escorting military units prevent Civ A from surrounding Civ B's city? Also, trade routes can switch between water and land -- if a trade unit has a naval escort, what happens when the trade unit shifts to land (or vis versa for a land escort when the trade route shifts from land to water -- even if the escorting land unit can embark, an embarked land unit is essentially worthless as a protector on water -- in fact, embarked units also need naval protection)?
All of those questions (and more) are probably answerable, but is the mechanic really necessary? if you're worried about plundered trade routes, you can refrain from sending trade units into the wild unknown, or you can station some military units in no-man's land along the route to clear the fog and prevent barbs from spawning near your trade routes. It worked that way in Civ V and I see no reason why it doesn't work in Civ VI.
As for the second alternative, why bother with an invulnerable unit that travels on the map? Just make trade routes "virtual" and not represented on the map. (And that could include "virtual" road creation -- it would kind of fun to watch a road slowly creep its way into existence between two cities without any "unit" making it happen). But trade routes have been vulnerable to highwaymen and bandits throughout history -- shouldn't that be represented in the game?