Willpower and mental energy are entirely pseudoscientific concepts. They co-opt sciencey language to sound smart, but they have no backing in experiment or observation. What exactly is this "mental energy" being expended on (converted to)? What is it's law of conservation, that we might call it "energy"? Is willpower defined as the consumption of mental energy per unit time, that we might call it "power"?
You could think that maybe willpower/mental energy is a resource you have to consume to suppress natural instincts like overeating or consuming a drug that triggers pleasure in order to achieve some long term goal. But then you find that some people routinely engage in behaviors that contradict basic natural instincts, and in fact find it very hard to stop doing those behaviors (e.g. cutting or other self-harm behaviors, suicidal tendencies). Are they just a font of mental energy?
You can argue the explanation but it's hard to argue the observation— kids are tired after school even with no physical exertion, knowledge workers are tired after work. People need to "decompress" after mentally taxing work, burnout is a thing.
Name it what you like, but your theory does have to account for people's lived experience. Why does studying make you tired? Actively using certain parts of your brain is a limited resource in some respect no matter how you swing it. The rules are super weird so maybe energy is a bad name but it's the best we have right now.
Oh, tiredness due to knowledge work is real, and relatively easily explained: you spend energy (real, physical energy - calories) on computation in your brain. Whether you're learning at school, designing bridges, driving, or what have you, there are measurable outcomes of your work.
But there is no obvious relationship between this and the concept of "expending mental energy" on combating your cravings. It's not at all clear that there is any measurable "effort" involved in not doing something like eating a sweet. Chess masters consume more calories during a tournament. People who avoid eating cake at a birthday party don't.
And yes, I have of course experienced the difficulty with not giving in to a craving. But I'm not at all convinced that it is the same thing as the difficulty of taking a math exam. If anything, my experience is that it's easier to control my cravings after accomplishing a difficult mental task then it is if I've just idly been watching TV all day.
You could think that maybe willpower/mental energy is a resource you have to consume to suppress natural instincts like overeating or consuming a drug that triggers pleasure in order to achieve some long term goal. But then you find that some people routinely engage in behaviors that contradict basic natural instincts, and in fact find it very hard to stop doing those behaviors (e.g. cutting or other self-harm behaviors, suicidal tendencies). Are they just a font of mental energy?