Product is 36 and 36=3*3*2*2.
So possible combinations are:
6-3-2 (sum=11)
9-2-2 (sum=13)
4-3-3 (sum=10)
9-4-1 (sum=14)
12-3-1 (sum=16)
18-2-1 (sum=21)
6-6-1 (sum=13)
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