Yeah, this is why your bleat about "the greatest good for the greatest number over the greatest time" is bullshit. It's unknowable.
(It also argues against the concept of rights.)
I should clarify.
Even though it's not entirely knowable, it's up to us to find out what that is as best we can.
Rights are a social construct based on utilitarianism.
Abortion, for example, is a good right for women to have. However, if we were in some universe where the human race was losing people at an alarming rate, you would see that right get tested.