About the 24 hours in a day a possible reconstruction of its introduction by ancient Egyptians is the following.
Ancient Egyptians used to devide the ecliptic constellations in 36 "decans" of equal lenght (360:36= 10). During a night at the average latitude of Egypt rise and fall (theoretically) 18 decans (each corresponds to 40 minutes of sidereal time), but due to dusk and twilight only 12 were taken into account when reckoning time at night. So they used to devide the night in 12 equal parts. Symmetrically they extended this subdivision of time also to the daylight and so we have 12 + 12 = 24 hours in a day.
About the usage of a sexagesimal unit by the ancient Babylonians I have read about two (at leat) possible explanations: a astronomical one and a mathematical one. The first considers an approximation of the measure of the year as 360 days and 360 = 60 x 6. The second considers the number 60 as a "good" number because it is neither too big nor too little and it has a high set of divisors: 2, 3, 4, 5, 6, 10, 12, 15, 20, 30.
Nota bene: these are only possible but not sure explanations and they are disputed by some historians of astronomy.