You obtain an affidavit from a certified mechanic indicating that your year and model car does not have license plate lights. You go on line and search for proof that the car does not have license plate lights, and you submit that to the judge. You take photos of the newly installed lights, and show that to the Judge. You do all that and hope for the best. (Dressing nicely and being polite goes a long way.)
Having good relations with the mechanic allows you to draft an affadivit for the mechanic to endorse. It would essentially indicate the facts of this vehicle, vin #, make, model, year and especially the missing "plate lights" issue. This would show the judge that your intent was in good faith when your first purchased the vehicle. The other legal advise that was given to you will also assist in getting this ticket dismissed.