Question: What is the literal meaning of "auf der Strecke bleiben"? What is the link between the literal meaning and the meaning "to fall by the wayside"?

Answer: 
Other than other people who answered here, I suppose that *Auf der Strecke bleiben* is not at all related to *Strecke* as *track* or *route*. Rather I suppose the phrase refers to an expression common with hunters. For them, by tradition since mediaeval times, *Strecke* is the quantity of animals caught and killed during the hunt, and displayed at the end of the event in a neatly arranged row somewhere on a meadow. Imagine hunters playing some music on horns in addition. 

One could debate, perhaps, if *Strecke* first meant the entirety of killed animals, or the place to display them. I have no opinion here. In any way, today both meanings are in use metonymically. 

Note that *killing someobody* is also

> 
> jemanden zur Strecke bringen
> 
> 
> 

which definitely is not related to *getting somebody to the route*. It is *getting somebody to be on display for successfully being hunted down and killed*. 

Admittedly *Duden Herkunftswörterbuch* (one of the more recent editions) claims that *Auf der Strecke bleiben* "probably" roots in sports, whereas *zur Strecke bringen* was related to hunting. But Duden does not give any evidence for this whatsoever, and I would dare doubting their judgement in this case. Rather than the relatively modern phenomenon of sports, a military context could be theoretically supposed, as Volker Landgraf did in his separate answer, with military men being left "on the track" during quick advance or retreat of larger military bodies. However, if that was the origin of the phrase, I would suuppose there were other words too like *auf dem Marsch bleiben*, which however does not exist. Contrary to that the existence of a phrase *zur Strecke bringen* which clearly is related to hunting, is a strong hint that also *auf der Strecke bleiben* is probably a hunting term.
As idmean has answered, it literally means

> 
> to stay on the track
> 
> 
> 

However, it is not so much about failing but rather about not being completed, being ignored/forgotten or being put at disadvantage, see here: [German examples](https://www.redensarten-index.de/suche.php?suchbegriff=%7E%7Eauf%20der%20Strecke%20bleiben&bool=relevanz&suchspalte%5B%5D=rart_ou)

> 
> "Mutti bleibt auf der Strecke. Frauen im Erziehungsurlaub drohen beruflich abgehängt zu werden"; \*Mum falls by the wayside. Women on maternity leave are threatened to fall behind in their jobs.
> 
> 
> "Ihr Geld bleibt auf der Strecke - Wertverlustprognosen für die 100 meistverkauften Modelle"; *Your money falls by the wayside. Lost in value predicted for top 100 sold models.*
> 
> 
> "Abrüstung bleibt auf der Strecke. An der Jahrtausendschwelle droht neue Runde im globalen Wettrüsten"; \*Denuclearisation stays on the wayside. Threats of new arms race in new millenial.
> 
> 
> "Deutsche Bahn will sparen: Behinderte Menschen bleiben auf der Strecke"; *Deutsche Bahn wants to save money: Handicapped people stay on the wayside.*
> 
> 
> "Kino digital: Die Kleinen bleiben auf der Strecke" *Digital cinema: Children stay on the wayside.*
> 
> 
> 

I delibaretely chose the *wayside* translation, although you probably wouldn't say it this way in English. If needed, I can provide proper translations.