"What can I do to convince the judge that they give him court mandated treatment instead of jail terms?"
I doubt that there is very little that you personally can do in this situation.
How old id your son? If he is a minor, you should probably obtain an attorney for assistance. If he is an adult, you could hire an attorney for him if you wanted. He might be able to qualify for a PD if he cannot afford a private attorney. In either case, he should consult with an attorney.
Criminal trespass could land him in jail for up to year and possibly a fine of up to $1,000. I suspect that the Obstruction and Battery charges carry similiar penalties.
Consult a local attorney.
"Never argue with stupid people, they will drag you down to their level and then beat you with experience." - Mark Twain