What we did was take an early train to Pingyao arriving at noon, taxi over to the town, wandered around then caught a 6:30pm train back to Taiyuan. Overnight there, then a soft sleeper leaving at 9am arriving at Datong at lunchtime. There were four of us too and it's much better than seats. Went to the grottoes and other sites close to town on one day. Hired a car/driver to go to Hanging Temples and Hengshan on another day and down to the Yanmenguan area on a third. It worked well.