They are different in meaning.
In #1, he is homesick, but the cause of the homesickness was not the sound of the trolley cars.
In #2, he is not homesick, and there is nothing in the sound of the trolley cars that would cause him to be homesick.
Some people may tell you that there is no difference in the two. That is because most people are no longer precise in their language use.