According to Einstein’s equation “E = m c^2” an object that loses energy loses a VERY slight proportion of its mass. An object that, on the contrary, gains energy also gains a VERY slight increase in mass.
Now, if an object (in space, or vacuum, say) moves or changes position, in general...