你辛苦了,in literally way , means I know you will/had have something to do , that cause you tired / waste time / unhappy / hard to get through /.... , I understand that feeling ,all in a word called "辛苦".
And in metaphorically way , means I (should) thank you for what you do.
路上辛苦了,in literally way , means the road to here/there is hard to get through , so 你辛苦了
in metaphorically way , it can be nothing to feel 辛苦 , but still , I should thank you to go / to come.
Even if there is no need to say thank ,one can say "路上辛苦了" to express a care/complaisance to another.That called "客套"or"客套話"