Burnout is ALWAYS a worry... I find it can often help to just take time away to help someone else with their problem before returning to your own -- be it in the workplace, or just try helping some random stranger on a forums! When it's someone else's problem it's not really stressful for YOU. Solving their problem can often give you that confidence boost needed to take your project to the next step... you might also learn something in the process because we don't all walk the same line. Someone else might be doing something you know HOW to do or could come up with a unique way to do, that you wouldn't think of even doing in the first place.
Strange as this might sound, I find that having multiple projects going at once also helps, as does breaking what you are doing into multiple smaller problems. You get stuck at one point, go attack another and come back after your brain's had time to digest the problem.
In the military there's what's called "tightening one's group shot" -- whilst it's often jokingly used to refer to applying a boot to the boot's patoot, it more properly means to create a distraction that makes the actual problem seem less stressful. You take the task they're failing at away from them, and give them some bullshit stupid pointless task (go pick me a four leaf clover maggot!) and stacking absurdity on top. (You found Mark! But where's his mom! You nimrod you separated this poor child from its mother!!!). Once you've got them utterly flustered over THAT pointless task -- amazingly you can sit them down and boom, instantly what was originally an obstacle they knock down with ease.
It's hard to self practice that on its own, but a good five to ten minute distraction... stop to listen to a song or two. Go read some article to learn more about related subjects you might use. Get your mind off the immediate problem to give the sub-brain time to get out of the funk.
I liken long term 'brainpower' work to the same breakdown of mental processes that can happen in any intensive task physical or mental. More so if you're just sitting there at a keyboard like a sloth. Get up, walk around the block. Give yourself time to 'recharge'.
... and don't push it. It's SO easy to NOT take the break. Again to use a military term, "Target fixation" -- where you become so fixated on one target or one task, you completely miss all the other bat**** going on around you... INCLUDING your own fatigue. That's why I suggest REGULARLY SCHEDULED breaks. REGARDLESS of if you think you need it or not.
You CANNOT sit there for hours on end at ONE task and remain productive. It just doesn't happen!
Oh and for the love of Christmas, AVOID stimulants. They only give you false energy so when you crash, you crash hard. It interrupts your normal sleep, it screws with the brain chemistry and normal internal clock. I know the joke about the "programmers diet" of Jolt Cola, weight loss pills, and dorito's... but trust me, you're only fooling yourself into THINKING you've got energy with the stims.
Kind of like how when you're drunk you think you're just SO witty and brilliant... when the reality is... well...