Let us first take a look at the first clue: "The product of their ages is $72$." This means that there are only $12$ possible sets of ages:
$$\begin{array}{|c|c|c|}
\hline \text{Age of 1st Son} & \text{Age of 2nd Son} & \text{Age of 3rd Son}\\
\hline
1 & 1 & 72\\
1 & 2 & 36\\
1 & 3 & 24\\
1 & 4 & 18\\
1 & 6 & 12\\
1 & 8 & 9\\
2 & 2 & 18\\
2 & 3 & 12\\
2 & 4 & 9\\
2 & 6 & 6\\
3 & 3 & 8\\
3 & 4 & 6\\
\hline \end{array}$$
Now let's look at the second clue: "When you add the ages of the sons, it will be the same as the number of apples on his his apple tree." Let us start by taking the sum of all the ages:
$$\begin{array}{|c|c|c|c|}
\hline \text{Age of 1st Son} & \text{Age of 2nd Son} & \text{Age of 3rd Son} & \text{Sum of 3 Sons}\\
\hline
1 & 1 & 72 & 74\\
1 & 2 & 36 & 39\\
1 & 3 & 24 & 28\\
1 & 4 & 18 & 23\\
1 & 6 & 12 & 19\\
1 & 8 & 9 & 18\\
2 & 2 & 18 & 22\\
2 & 3 & 12 & 17\\
2 & 4 & 9 & 15\\
\color{red}2 & \color{red}6 & \color{red}6 & \color{red}{14}\\
\color{red}{3} & \color{red}3 & \color{red}8 & \color{red}{14}\\
3 & 4 & 6 & 13\\
\hline \end{array}$$
From this, notice that both $(2,6,6)$ and $(3,3,8)$ both add up to $14$. This is where the clue comes into play. We know that one of these two sets is what we are looking for, since Mathematician $B$ cannot find the ages from counting the apples on the apple tree.
Now that we are left with two possible sets, we look to our third clue. The third clue states: "The eldest son loves to play basketball." This means that there is only one elder son, and that there cannot be two identical large numbers in our set. Therefore we can eliminate the set $(2,6,6)$ and are left with $(3,3,8)$.
This means that the ages of the Mathematician $A$'s sons are $3$ years old, $3$ years old, and $8$ years old.