I'm sorry to hear about what happened to you. Unfortunately pity will not go over with a judge. Their job is to determine innocence or guilt and not be partial to those claiming they have a hardship.
I'm surprised that the police went through the trouble that they did for nothing. I'm wondering whether you admitted that you were drinking. And if you were completely honest and admitted to him that you drank alcohol and had an empty cup, you may still be in violation of the state's minor in possession statute. I don't know what statute you were cited but let's assume it is the following:
25658. (a) Except as otherwise provided in subdivision (c), every person who sells, furnishes, gives, or causes to be sold, furnished, or given away any alcoholic beverage to any person under 21 years of age is guilty of a misdemeanor.
(b) Except as provided in Section 25667 or 25668, any person under 21 years of age who purchases any alcoholic beverage, or any person under 21 years of age who consumes any alcoholic beverage in any on-sale premises, is guilty of a misdemeanor.
(e) (1) Except as otherwise provided in paragraph (2) or (3), or Section 25667 or 25668, any person who violates this section shall be punished by a fine of two hundred fifty dollars ($250), no part of which shall be suspended, or the person shall be required to perform not less than 24 hours or more than 32 hours of community service during hours when the person is not employed and is not attending school, or a combination of a fine and community service as determined by the court. A second or subsequent violation of subdivision (b), where prosecution of the previous violation was not barred pursuant to Section 25667 or 25668, shall be punished by a fine of not more than five hundred dollars ($500), or the person shall be required to perform not less than 36 hours or more than 48 hours of community service during hours when the person is not employed and is not attending school, or a combination of a fine and community service as determined by the court. It is the intent of the Legislature that the community service requirements prescribed in this section require service at an alcohol or drug treatment program or facility or at a county coroner's office, if available, in the area where the violation occurred or where the person resides.
As you can see, consumption of alcohol is what is required to be found guilty of the statute. If you admitted that you drank alcohol, you probably have a problem in court.
My thought is that you probably want to have an attorney. If you cannot afford a criminal defense attorney then the court may appoint one but in some states and courts this may not apply, especially if you are given a citation or misdemeanor where you will not be facing jail time. Given that you're understandably concerned about the situation, you may want to obtain the services of a criminal defense attorney who may be able to help, or at the very least negotiate for you to have some type of alternative sentencing. With alternative sentencing it's possible to be granted some type of probationary period which, if completed successfully, the charges would be dropped completely. Given that there is also a mug shot, you're probably best served retaining a criminal lawyer to deal with the repercussions. The Internet is can be a brutal place, especially when mug shots are involved.