The wording of the hadith in this regard is general, not detailed (that is, the hadith mentions performing Hajj on behalf of an old man, but does not mention a woman; however, Hajj can be performed on behalf of both men and women).
Imam Hasan Basri (may Allah have mercy on him) says that it has reached me that a man came to the Messenger of Allah (peace and blessings be upon him) and said: "My elderly father has accepted Islam and he has not performed Hajj, nor can he sit firmly on a mount, and if I tie him to the mount with a rope, I fear that I might kill him." So the Messenger of Allah (peace and blessings be upon him) said: "Perform Hajj on behalf of your father."
Hadith Referenceصحيح ابن خزيمه / جماع أبواب ذكر أفعال اختلف الناس فى إباحته للمحرم، نصت سنة النبى صلى الله عليه وسلم أو دلت على إباحتها / 3037