Sefas Emes (Vayikra Pesach): And they believed in G‑d and His servant Moshe –It is known from seforim that by means of faith in the sages (emunas chachomim) a person can come to have faith in G‑d. That is because faith in G‑d is a higher level than faith in man. However this is from the perspective that “I am first and I am the last.” That is because in reality, faith in G‑d both precedes and causes faith in the Sages. But it is only after having faith in the Sages that a person is able to have true faith in G‑d. This order is what we see here. The Torah first says that they believed in G‑d and then afterwards they believed in Moshe. After that they sang “az yashir…” Thus we see by their singing the praises of G‑d by the sea, they were brought to true faith.