「姉がその曲を聴いている」=「my older sister was listening to that song」、「横で、たまたま通りかかった」=「As I happened to pass by next to her」、「私もその曲を聴き」=「I also heard that song」、「私も好きになった」=「and I also came to like it」、というわけでこのように翻訳できると思います:「As my older sister was listening to that song, I happened to pass by next to her and that's when I heard it. Thanks to that I've also come to like that song.」
I was just passing by my sister who was listening to that song, I listened to it and I also liked it.
I was just passing by when I heard a song my sister was listening to and I liked it too.
I just happened to be passing by when I heard a song my sister was listening to and I liked it too.
「通りかかる」の英語は”to pass by”です。”pass”は「通る」という意味で、”by”は「当たり」や「付近」という感じです。活用されるのは”pass”なので”passing by”, “passed by”, “passes by”などというふうに書きますね。
「たまたま」の英語は”just happened to be”や”just”だけでもいいと思います。
「妹がその曲を聴いている横で」は”by the side of my sister who was listening to that song”ですが、別に”side”を入れなくてもイメージがなんとなく出来るかと思います。
さっきのは関係詞節です。英語の関係詞節では、もうひとりの主語の場合は”〇〇”+ “who”+”動詞”はよくあるパタンなので覚えると文章はもっと書きやすくなると思います。
例
I know a lady who eats lunch at that restaurant every week.
そのレストランで毎週ランチを食べる女の人を知ってます。