Turkmenistan Airlines has four flights per day to/from Ashgabat (51M). If time is short, you could take a morning flight, visit Merv and return on the same day to Ashgabat. The airport is 8km east of the city, on the road to Merv.
Mary’s modern train station has trains to Ashgabat (platskartny/kupe 4.14M/7.72M, 7½ hours), as well as to Turkmenabat (3.61M/6.51M, four hours). There is no left-luggage facility, but the station does have an international phone office and exchange facilities.