I think the answer is :
(6, 12) or (6, 36)
If x is NOT one of 6, 12 or 36, then the first mathematician would know the other one's number, so the numbers are definitely 6, 12 or 36.
If x was 6, then y could be either 12 or 36 (as 36 to the 6th power is also an answer). So first mathematician can't be sure. Therefore his number is 6.
The second mathematician's number is either 12 or 36, so he knows x must be 6. Then the first mathematician knows that the numbers are either (6, 12) or (6, 36).