Product is 36 and 36=3*3*2*2.
So possible combinations are:
Note that only 9-2-2 and 6-6-1 give the same amount when added.
Obviously, the second man must know how many beers they have drunk, so he knows the sum.
If he cannot decide yet it's only because the sum is 13 and there are two combinations that add up to 13.
And as we learned further that the oldest son wears a hat, it is clear that the correct combination of ages is 2-2-9, where there is exactly one of them the oldest one.
So the Age of Peter's Children is 2,2,9