The simple, straightforward, and therefore politically impossible solution is to require parity in funding for the district attorneys' offices and the public defenders' offices.
I think it should go beyond that, in that public defense and prosecution should come from the same pool of lawyers and they are graded by success on both sides by type/class of case.
The fact that this isn't the case after 200 some odd years exposes us. We don't care about the right to a fair trial for people who don't have money, it's a lie we tell ourselves.
As someone who absolutely agrees with this in principle, I disagree with "simple and straightforward" - you need to look at case categories (felonies and classes thereof, gross misdemeanors and misdemeanors) for a view on expected effort, and then you need to look at "what proportion of those cases have private representation".
And then this will always be a trailing metric.
I mean, personally I think the simple answer is just blanket equal resources, but there's no motivation to make that happen, but certainly won't be without things like the above.
Elected prosecuting officials is a bad thing, IMHO. The incentives are all wrong. They get elected and re-elected on "being tough on crime", which means convictions, which leads to the simple fact that the US abuses the concept of the plea deal enormously.
Thousands of people who would otherwise be found not guilty (if not are factually innocent) accept plea deals just to be done with a process that can take years to resolve (not to mention money, or freedom, or both, in the interim).
In other countries the use of the plea deal is generally fairly rare, and comes with stringent judicial oversight. Here it is often the first option. "Well, what would your client plead to?"