If it’s to stop you from actually falling asleep then chewing gum works. There’s a scientific explanation that I can’t remember but my experience is it works pretty well.
If it’s to stay productive then your brain probably needs the sugar and it’s more a question of finding the healthier option. Fruit and nuts sounds good.