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: 
"auf der Strecke bleiben" literally translates to 

> 
> to stay on the track
> 
> 
> 

Duden explains:

> 
> wohl aus dem Bereich des Sports und eigentlich = bei einem [Lauf]wettbewerb nicht das Ziel erreichen
> 
> 
> 

While "fall by the wayside" comes from biblical allusion, the German expression seems to be more of a metaphor. You failed something like somebody who stays on the track will never cross the finishing line.
Imagine an army making a forced march, maybe being pursued by enemy troops. Some soldiers will run out of energy to march on and collapse so they stay on the track instead of reaching the destination.