Let the present ages of the two boys be \(3x\) and \(7x\) years.
After 2 years, their ages will be \(3x + 2\) and \(7x + 2\) years respectively.
According to the problem, the ratio of their ages after 2 years will be 5:9.
Therefore, we can write the equation:
$$ \frac{3x + 2}{7x + 2} = \frac{5}{9} $$
Cross-multiplying, we get:
$$ 9(3x + 2) = 5(7x + 2) $$
$$ 27x + 18 = 35x + 10 $$
$$ 18 - 10 = 35x - 27x $$
$$ 8 = 8x $$
$$ x = 1 $$
So, the present ages of the two boys are \(3 \times 1 = 3\) years and \(7 \times 1 = 7\) years.
We need to find the ratio of their ages after 10 years.
After 10 years, their ages will be \(3 + 10 = 13\) years and \(7 + 10 = 17\) years respectively.
The ratio of their ages after 10 years will be \(13:17\).
Therefore, the correct option is (D)