From my experience, workout draws exactly from the same pool as mental effort, so after a tough day at work/school, there is little left for a workout and vice versa. Instead of brain spending its energy on thinking, it spends it on muscle/movement coordination.
I find it easier to work out when being mentally exhausted than doing something mentally challenging when physically exhausted. My main sport is climbing and it is perfect for a Friday evening when I am exhausted from my research and teaching job.
Also there are all these feedback loops. Staying active gives motivation to do mentally challenging things, and some of this mental energy can also be invested in learning new ways of staying active!