He may be able to expedite his case, if the prosecutor and court are made aware of his expiring visa and need to leave the country. He should speak to a criminal defense lawyer in whatever state and county are involved.
Ideally he will want to avoid a drug conviction. As we don't know the exact charge involved, consulting an immigration lawyer or a criminal defense lawyer who is familiar with immigration issues makes a lot of sense.

