Next time, make sure you check the bulb and ensure that it is not damaged or ruined, as this could likely affect performance of the light. And it would certainly affect performance of the light in the latter case.
Alternatively, you could work around your issue temporarily by using your head lamp while you drive; this adds the benefit of getting light where you are looking, and not where the bike is going.
I see you're playing on a community server. Maybe you could ask the admins to add a mod that makes head lamp batteries never run out?
Then it's actually even better than using the lamp on the bike; of course if you favor realism you may not be keen to this change.