The problem with going to court is not only having to pay the fine, but also added court costs.

However, if you have not had any previous tickets, you could talk to the prosecutor on the day of your initial hearing before session starts and ask if you could attend a driver improvement class in order to get the ticket dismissed. If he/she agrees, you'll still need to plead guilty, but if you pass the class it will be dismissed. They usually give you two months to complete the course, obtain the completion certificate and file it with the court before your next scheduled appearance. Some states even allow you to take the course online. Which ever method you choose, you'll want to do it early as possible in order to get the certificate to file on time.

There will still be a fine to pay, which you could probably work out a payment plan. And the cost of the class. But if you get the ticket dismissed, it won't go on your record and your insurance won't be notified.

Note that if you try your excuse, the judge could raise a couple of questions (1) what do you think would have happened had your lights failed while speeding (reckless driving), and (2) why didn't you pull over someplace safe and just try revving the engine to charge the battery.