The Church, which is certainly something of a gerontocracy, excludes the elderly Cardinals from Papal elections too. It's not intrinsically unjust anymore than excluding the very young is.
To be fair, that limit is 80 and likely has more to do with not forcing elderly Cardinals to travel (many would and even still do out of a feeling of duty; it's basically literally the only "job" a Cardinal has that's not just him being a bishop).
Currently, bishops are generally expected to submit their resignation to the pope upon turning 75 years old, although the pope may elect to retain the bishop.