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.
My prefered literal translation would be "left/remain on the way/track" - never arrived or finished. (I would not translated it into "stay on track" - this would rather translate to "in der Spur bleiben".)