Sadly, I don’t believe that most mentally ill, homeless addicts are going to get better. It’s a terrible situation, and I don’t know of a solution.
I don’t think anyone does.
I would also note that most rehab facilities for substance use disorders espouse an abstinence-based approach to treatment. That approach simply doesn’t work. The standard of care for opioid use disorder is medication assisted treatment, which is both evidence-based and far more effective than abstinence-based programs. The difference in outcomes is stark, particularly since dropout often results in death.
Bottom line, though, from my perspective: you can’t effectively treat people unless and until they are motivated to enter into and engage with a treatment program. “Junkies” of the type you describe rarely fit that bill. Drug courts are a good step in the right direction, but they need to take a more evidence-based approach to their operations.
I wish there was an easy solution to this problem, but there isn’t.