If the song was Moses’ spontaneous response to the miracle of the Red Sea, how could the Israelites have joined in?
Ibn Ezra suggests that Moses composed the words and then taught them to the Children of Israel.
The Midrash Tanchuma holds that Moses sang, but as leader he was singing on behalf of the people as well as himself.
Amongst the Talmudic sages some say that the first verse (“I sing to the Lord…”) was the chorus with which the people responded after each verse which Moses sang.
There might be a further way of looking at the problem.
Tradition says that at the moment of the miracle, when Israel crossed the sea on dry land, everyone was gripped by faith. There were no doubts. All knew that there was a God. The prophetic mantle had descended upon leader and people alike.
They were one in thought, one in feeling, one in soul, and one in song. So Moses and the Children of Israel truly did sing together.