We present a spatially resolved analysis of the temperature and gas density profiles in six relaxed galaxy clusters at z=0.4-0.54 using long-exposure Chandra observations. We derive the total cluster masses within the radius r500, assuming hydrostatic equilibrium but without assuming isothermality of the intracluster gas. Together with a similar study based on the XMM-Newton observations (Kotov & Vikhlinin), we obtained the mass and temperature measurements for 13 galaxy clusters at 0.4<z<0.7 spanning a temperature interval of 3 keV<T<14 keV. The observed evolution of the M-T relation, relative to the low-redshift references from the Chandra sample of Vikhlinin et al., follows M500/T3/2~E(z)-α, where we measure α=1.02+/-0.20 and 1.33+/-0.20 for the spectroscopic and gas mass-weighted temperatures, respectively. Both values are in agreement with the expected self-similar evolution, α=1. Assuming that the cluster mass for a given temperature indeed evolves self-similarly, the derived slopes, γ, of the high-redshift M-T relation, E(z)M500~Tγ, are γ=1.55+/-0.14 for Tspec and γ=1.65+/-0.15 for Tmg. Our results show that both the shape and evolution of the cluster M-T relation at z~=0.5 are close to predictions of the self-similar theory.