Historians say that Joshua 24 follows the format of a Hittite suzerainty treaty. The cultures of the Ancient Near East had many common elements, so this isn't surprising. Israel had some very distinct differences, though, not the least of which was the form of government that YHWH instituted.

In v1, "all the tribes of Israel" means representatives from all the tribes, not every member of every tribe. See also 23:2. This verse describes five levels of government in ancient Israel:

1) THE Judge (Joshua)
2) Elders (70 or 12?)
3) Clan or Tribal Patriarchs
4) Judges (for each city & town)
5) Officers (militia commanders in each city & town)

The priesthood is curiously missing. Perhaps because it is a parallel government without direct authority except at the Temple and at the highest court of appeals.