Sometimes people have to wear sunglasses because the light, even dim light, hurts their eyes. Light is even more even painful for these people when they cry and their eyes are irritated.
Light-sensitivity can be caused by various medications.
My workplace supervisor has this problem. She does a lot of her work in very dim light, and she often slips on a pair of sunglasses during the day indoors because the light hurts her eyes.
Another possibility is that the mourner normally wears contact lenses, but it unable to wear them due to crying. Perhaps the sunglasses are the only pair of glasses at their prescription that they own.
Even if the cause of the sunglasses is not light-sensitivity or contact lens situations, I think at a funeral, we need to be especially charitable to those who are mourning and encourage them to do whatever comforts them provided that it is not blasphemous or indecent. There are many people who are very uncomfortable with crying in front of others, so why shouldn’t they wear dark glasses if it helps them to make it through the various public memorials?