"路过" and "通过" are not exactly the same, though meanings are similar to each other.
"路过" normally talking about someone or something pass through a loaction or place. And in Chinese lanmguage, the word "路" means "road". That's why "路过" more likely implies that someone or something walking through a location or place. eg. 路过一间书店(In English, it is walking through a book shop,"book shop" is a location or place )
But for "通过", even it also means pass through as well, Chinese people are accustomed to use the words following a process or procedure , instead of a location or place. eg. 通过安全检验 (In English, passing a safety inspection, "safety inspection" is a process or a procedure)