The article considers the problem setting of the coupled thermal-structural problem arising in the process of modelling the surface hardening using electromechanical treatment (EMT). A mathematical model is presented with respect to forming the structure of metallic alloys with EMT based on a joint analysis of the calculated data on the dynamics of temperature fields and continuous cooling transformation diagramby using the Ti6Al2V titanium alloy as an example. Kinetics of the martensitic transition during EMT is described using Koistinen-Marburger equation. An algorithm of solving the thermal problem based on the finite element method in the weak Galerkin form is given. The calculated area is approximated by Zienkiewicz type infinite elements. Based on a series of computational experiments, the influence of the magnitude of the time step on the accuracy of the problem solution was investigated. The significance of the considered coupled and nonlinear effects which are specific for high-speed high-temperature thermal processes are analyzed, e.g. the change of the thermophysical properties of the metal, latent heat of phase transitions, thermal radiation and dependence between the metal physical properties and temperature. Two methods are used to consider the effects aiming to solve the thermo-structural problems: a totally coupled non-linear problem using the direct iteration method of Picard in a combination with the relaxation formulae for the convergence acceleration; the quasilinear solution when the values of the nonlinear terms are calculated on the basis of the temperature distribution obtained in the previous time step. Based on the series of numerical experiments, we analyzed the unsteady temperature fields, as well as the distribution of structural domains after EMT in the titanium pseudo-alpha-alloys.