Yes Ahmed AlHasan is the son of Imam AlMahdi meaning that he is from his sons. He is from the fifth generation of Imam AlMahdi.

It is normal in the Arabic language and Islamic context for the word son to mean a descendant. For example, Prophet Muhammad has said numerous times that he is the son of Abraham, and of course he is from the descendants and not the direct son. And same for the 12 Imams where they are called many times “son of Allah’s messenger Muhammad”, meaning son as a descendant and not direct sons. And same with Ahmed AlHasan being the son of Imam AlMahdi.

Below is a picture of the family tree of Ahmed AlHasan, it shows the five generations stemming from Imam AlMahdi. You can click on the picture to view a higher quality version (and also download a copy).