Again, they can't know for certain how old a star is. They assume that they do know, because stars have enough energy to burn for billions of years. So when they see a red giant, they assume it's been burning for billions of years, because of a red giant is at the end of it's life.
Makes sense, right?
But that's assuming the universe is millions of years old. It would basically be like estimating a candle's age based on how much of the wick is left---but without knowing how long it was to begin with.
What if the universe was created? If was created, say, 10,000 years ago, there's no reason why stars of differing sizes couldn't have been made, as well as differing levels of fuel in order to add color variation in the stars.
I honestly have no guess whatsoever as to the age of the universe. For all I know, it could be millions, it could be thousands. But we still can't know for certain how long a star's been in existence. We can know how much longer, but not how long it's already been there.