I know Madara and Kaguya both said they're immortal, presumably because of the Juubi. Because why not.
But if they were actually immortal then why was Hagoromo, a Juubi Jin, aging and, you know, dying? Is there something I'm missing here?
According to the manga, it seems that his control over Juubi had weakened for some reason, to the point where he had to unseal it and then to die due to old age and lack of Juubi's chakra. The reasons of this is unknown, because if it's just old age, the question "why Kaguya is immortal" remains.
I think it's a good possibility that Hagoromo, seeing as his ideals failed, simply decided to pass on, "permamently" solving the issue with Juubi by dividing it, and letting the future generations to decide their future themselves. If you think about it, at that point it was the only logical choice for him.
But then again, all we can do is to assume. Nothing is for certain.