This is what I know... and from my own logical explanation.
Hair are basically dead cells. So when a person passes on and is buried, dead cells continue to form. And I kinda think that when dead cells are formed, it probably is sent to the hair and thus, making the hair grow. I believe there's a kinda scientific explanation to it unless something that's seriously weird happens, like if they open the casket, etc. after about 20 years or so, they find another new limb? Or maybe the eyes have opened back, or maybe the body faces sideways or faced down already, or maybe curled up like it's cold or something. Even more freaky, the limbs all straightened upwards and then they pry open the casket, the cover just goes POP and flies open, with the body sitting upright and the hands and legs all stretched out straight !