I don't think Xue Fang Fei is as old as 29-31.
Her husband was poor and wanted to be a scholar. Let's say she married at 15 and he was 17 (give or take). It probably took him a couple of years to study. Then he passed with great merit and was promoted. Let's say it took it a few times because those exams were difficult. Five years should give enough time for XFF to suppress her amazing intellect and be just a wife, being obedient and bullied. So she was probably 21-22 when she was offed by SYR.
The Duke's age is harder to guess. During Jiang Li's beating of the Deng Wen drum, one of the bystanders said the last time the drum was beaten was over ten years ago (by the Duke), so it's been over a decade. So, let's say, he was ten or eleven, so that makes him the same age as XFF/JiangLi. If he were older when he beat the drum (because boys tend to look younger), he would be around 24 or 25. This actually made more sense to me because the Emperor and his doing the handshake thingy scene looked like they were around 15 (the way they talked). Eight years had passed since that handshake, so that would make him 23 or 24!
The Crazy Princess is older than the Emperor.
Stepmom was in her 30s. She probably didn't marry Bai at 15 exactly because he had a Principal Wife (Jiang Li's mother). She probably spent a few years pretending to be her friend while poisoning her. So, let's put her around 33-34.
Which makes Consort Li around 31-32 because she was the Mei Mei, right? The actress looked a lot older, though!
All conjecture, of course, haha.
We forget that people didn't live that long, then. Most died in their 30s and 40s, so they were adults at a very young age. Girls run households with full control of the finances and dozens of servants by 13 or 14! A war general could be just 21 (ala Ling Bu Yi)! Alexander the Great, while conquering the then world, was 33 when he died, after all. It's amazing how much the Ancients accomplished without any machinery, Internet or sleep, apparently, heh.