The one with the most right to lower a woman into the grave
Narrated Anas bin Malik:
We were (in the funeral procession) of one of the daughters of the Prophet (sallallaahu alayhi wa sallam) and he was sitting by the side of the grave.
I saw his eyes shedding tears. He said, "Is there anyone among you who did not have sexual relations with his wife last night?" Abu Talha replied in the affirmative.
And so the Prophet told him to get down in the grave. And so he got down in her grave.
Sahiih al-Bukhāri
A woman can be put in her grave by Mahrams and non Mahrams. It is best her mahram does it except when there is among the men who didn't have sexual intercourse with his wife that night. In that case he has the most right to lower the body of the woman into the grave.