in Paradise Lost, he references tons of ancient religious figures. Where would Milton have learned these things?
Because Hermes Trismegistus told him the secret of the sacred writing and he read the walls of the pyramids of Unas.
Plutarch and Diodorus Siculus both wrote long accounts of the Egyptian gods. The words "Osiris", "Isis", and "Horus" are all Greek words, not Egyptian words.
Milton makes extensive reference to both authors in his poems. For example, he mentions the island of Nysa, described at length by Diodorus Siculus.
He had a very good education for the age – as Encyclopaedia Britannica says:
The elder John Milton [...] enrolled his son John at St. Paul’s School, probably in 1620, and employed tutors to supplement his son’s formal education. [...] Educated in Latin and Greek there, Milton in due course acquired proficiency in other languages, especially Italian [...]. Milton enrolled at Christ’s College, Cambridge, in 1625 [...] In 1629 Milton was awarded a Bachelor of Arts degree, and in 1632 he received a Master of Arts degree.
I'd believe he learnt Egyptian mythology through Greek or Latin sources, like Herodotus.
Before the deciphering Egyptian hieroglyphs, the Ancient Egyptian culture and history was known though the writings of the Hellenistic Greeks who conquered Egypt under Alexander. (Some information comes from earlier Greek writings, like Herodotus.) These Hellenistic Greeks were not very interested in the history of Egypt, indeed the first Hellenistic ruler who learned Egyptian language was also the last of them (Cleopatra VII). But there was an Egyptian writer, Manethon in the Ptolemaic Egypt who wrote Egyptian history in Greek. Most later Greek and Roman writers re-told the Egyptian history from Manethon, or from secondary sources, based on Manethon.