If an insomniac can't fall asleep, and it's almost 3 am, is it better to just stay awake or just sleep?

Get out of bed! Do not stay in bed. Do not read in bed, do not watch tv in bed, do not eat in bed. Your brain needs to associate bed with sleeping . Chronic insomnia needs properly evaluated for a cause, but poor "sleep hygiene" needs corrected asap.
Sleep. It would be better to get as much sleep as possible. Get a consult with a sleep physician to see if they can help you with your insomnia.