If you need high accuracy distances, or "ground" distances, you need to convert your UTM "grid" distances (which you do indeed calculate via pythagorous) using a combined scale factor. This removes the distortion introduced by the combination of (a) reducing the horizontal distance at its elevated (above the ellipsoid) position on the earth and (b) projecting this length from the curved ellipsoid onto the flat map.
ground distance = grid distance / combined scale factor
combined scale factor = elevation scale factor * projection scale factor
It is the kind of conversion that land surveyors do often. UTM combined scale factor values typically range between approximately 0.999 and 1.001 but the actual values depend on how high you are above or below the ellipsoid (or datum) and on how far east or west you are from the UTM zone's standard lines.
The UTM projection scale factor can be calculated from a rather complicated formula or from look-up tables.
Note that for long lines (5km or more), use the Simpson rule for an average projection scale factor:
S = (S1 + 4 Sm + S2) / 6
in other words, one sixth of each of the two end factors plus two thirds of the middle factor
Also note that the elevation scale factor is sometimes called a "sea-level" scale factor but it is a function of ellipsoidal elevation, h, which is the sum of height above the geoid (sea-level), H, and the geoid-ellipsoid separation, N:
h = H + N
Your height above the sea-level is found on topographic maps. Your geoid-ellipsoid separation is generally found in geodetic look-up tables -- there is no simple calculation for it.
The elevation scale factor, ESF is then
ESF = (R + h) / R
where R is the Earth's radius.
For references, please search books on surveying or geodesy or search for various of the above key terms.