In order to learn an ancient language, scholars usually rely on one (or several) of the following:
- Knowledge of related extant languages. In case of Egyptian, Koptic was the clue.
- Bilingual texts where one of the two languages is already well known. In case of Egyptian, the famous Rosetta stone was of great help.
- Some knowledge about the writing system (Cuneiform was used for several unrelated languages, but knowledge of the writing system could be transferred). Same is true for Etruscan: It can be read (but not everything is understood).
- Transcriptions of proper names into better-known languages help both on pronunciation and on deciphering an unknown writing system.
Ancient pronunciation is a difficult theme, and scholarly informed opinions on the pronunciation of Ancient Egyptian have changed considerably over time. Usually, the focus lies on understanding the Ancient texts, not in pronouncing them correctly.
EDIT: Since Ancient Aramaic is a well documented language that is taught on universities (e.g., for students of Christian theology or Semitic languages), there are grammars, dictionaries and even teaching materials and courses available. There is also the Bible in Aramaic language, a text with many local translations. This makes life much easier than the situation sketched above.