Without a strong working definition of trial it remains somewhat difficult to answer the OP, but I would say most advanced civilizations (and I use that term to refer to civilizations that developed writing, currency, agriculture, and some form of semi-centralized government) had some form of “procedural mechanism” for adjudicating crimes. In fact in researching this I saw an interesting passage from a 130 year old book on Ancient Jewish criminal jurisprudence, that defines a trial as implying the presence of: 1, a competent tribunal; 2, an accuser or prosecutor; 3, an accused. By that rough definition even the Ancient Chinese magisterial proceedings would meet that definition.
Let me add the typical caveats: lots of societies have existed that we lack much written history of, and could be exceptions to the rule. But I spent some time trying to “find the negative” on this–i.e., a known advanced civilization that had no criminal process at all. Which would mean either the government entirely left it up to the citizens to handle matters of criminality, or the government just had agents executing punishments entirely on whim with no process at all.
A number of cultures seemed to have a “Judge” model, where some form of judge would be empowered to make decisions. The process this judge ran might sometimes look like an Anglo-Saxon trial, but often times it might instead look like more of a police investigation where the judge is also the decider of fact and punishment.
Speaking from a sociological perspective I have to imagine it’s a fairly natural process that as a civilization reaches a certain point, some means aside from “personal vendetta” would be seen as desirable to settle criminal matters. Long before ideas about justice, the rights of the accused etc were common place, if nothing else having some sort of government arbiter helps to avoid societal disorder and other problems. At the same time from everything we know about history, pre-modern societies even when they had a formal legal system, settled much more in the way of disputes informally than is common in modern Western countries. Corruption was likely almost universally much higher than modern Western countries as well. The descriptions of the Ancient Chinese magistrate system describe a system in which corruption is a standard and probably even typical way matters resolved. The magistrates in some eras received bonuses for convictions, had a statutory time limit during which they HAD to obtain a conviction, and the men they employed to go out and find and arrest criminals were financially motivated as well. So likewise if you had money to make it more worthwhile to dispose of the case to your advantage, that could often be arranged.
Going to the example of the Ancient Jewish people, we see standards of criminal procedure going back over 2200 years that actually would still make some level of sense in modern times. The 1890 book I was looking at refers to Jewish tribunals as “synhedrion”, although I think that term fell out of use with later writers and the more commonly known “Sanhedrin” term is used to describe these tribunals (I’m not good at etymology but it looks like both words are ultimately derived from Greek.) There were Sanhedrin in every city and they were expected to try cases impartially–enforced by requirements that no one sitting on the tribunal could be related to the accuser or the accused, and other requirements such as a requirement that the members of the tribunal must not be experiencing “discord” among themselves–because distaste for another tribunal member might cause one to vote simply to spite that member, and not in the interest of justice.
The accused were imprisoned upon accusation, but were prohibited from being molested or abused in any way, and assaults or etc upon them were punishable as crimes. Evidence of at least two witnesses was required for conviction, and in the penumbras of these requirements you find a presumption of innocence, unlike the Ancient Chinese system that welt torture could be appropriate to wring the truth out of the accused, the Jewish system treated the accused as innocent persons until convicted, and protected them from physical abuse.
Even still these courts would produce results we’d consider shockingly unjust by modern standards. Simeon ben Shetach was held up as a paragon of justice in his day, but he presided over the mass execution of lots of women on the charge of “sorcery.” There is a tale (probably a parable) about the relatives of 80 women who were executed for sorcery during one of these purges, these relatives sought revenge, so they accused Simeon’s son of a capital crime and bore false witness against him. After his conviction, they admitted to having born false witness, Simeon asked that the case be reopened and retried in light of this–but under the law, past a certain point, witness statements could not be recalled as the assumption was they might be recalled dishonestly. Simeon’s son is said to have told his father that he must uphold the Law to stand as a divine example to others, so they proceeded with the execution despite knowing the convicted was innocent.