It was not unusual for men in their late 20s or early 30s to command battalions in the Napoleonic Wars. At sea many Post Captains (full colonel equivalents) were in their 20s.
The phenomenon of youthful command in wartime was not just a Napoleonic occurence. Massive expansion of armed forces under the pressure of war always causes it. In the Second World War there were many battalion commanders in their 20s. In the Royal Air Force Guy Gibson was promoted to Wing Commander (Lieutenant Colonel equivalent) at 23 and commanded the Dam Busters raid aged 24.
In the British Army today most battalion commanders are in their mid 30s.