They drank water from their waterskins/metal canteens, filled from larger wooden casks which were brought along the march. Persians, Egyptians, Assyrians, Greeks, Romans, and other ancient societies all were quite advanced as far as army logistics, including water supply. See this answer from several years ago.