The correct answer is to start trial within 30 days of arrest - no exceptions. If the prosecution isn’t read for trial that soon, then the arrest was premature.
Holding a person for 2 years without a trial is nonsense!
Perhaps the higher courts could have imposed a time-limited bond. It reduces in time like a price in a Dutch auction. Suppose the bond is reduced by 10% on the remaining balance every month. If a miscreant gets out on the streets, then it is on the prosecutor’s office and courts who couldn’t manage to bring it to trial.