While Lamar Johnson has spent 24 years in a Missouri prison, evidence of his innocence has steadily mounted. Two other men who confessed to the murder attributed to Mr. Johnson said he did not do it. And the only eyewitness against him — without whom prosecutors said they had no case — later recanted.

This year, after his fruitless declarations of innocence from behind bars, prosecutors from the same office that sent him away for life in 1995 decided that he was innocent and asked a judge to grant him a new trial. The response was swift and not in Mr. Johnson’s favor: The Missouri attorney general weighed in, helping convince the judge to deny the request.

The pushback faced by prosecutors in Mr. Johnson’s case is not unique. Across the country, similar clashes are playing out as prosecutors who were elected in recent years promising a different approach to criminal justice have seen some of their efforts frustrated. O pponents with a more traditional view of law and order are taking concrete steps to try to block them in court and strip them of discretion or money to run their offices.

From the start, these prosecutors met fierce criticism from law enforcement and other elected officials when they promised to crack down on police misconduct, prosecute fewer nonviolent crimes and reverse potentially wrongful convictions.