By Pythagoras, a 21, 28, 35 triangle has a right angle opposite the 35 side.
If we want the two circles to be as large as possible, they need to both be tangent to the long side of the triangle, each tangent to one of the other sides of the triangle, and tangent to one another. This is shown in the above diagram.
The small triangle in the middle has sides parallel to each of the sides of the overall triangle, and is therefore similar to it. We know the long side is twice the radius, therefore we can calculate the other sides in terms of r. The rest of the horizontal line can be calculated to ensure the overall length is the given 21. Likewise for the vertical side. Because of tangent lines from a point, these lengths can be copied to the hypotenuse of the triangle. We have the resulting equation for the length of the hypotenuse:
35 = 21-6r/5-r + 2r + 28-8r/5-r
35 = 49-14r/5
14r/5 = 14
r=5
And so therefore the radius of the circles is 5 units.