If you wanted to take a train to Hong Kong, you'd have to go to Shanghai first. That might have a bearing on your decision. There, probably, are direct flights from Wenzhou to Hong Kong (I haven't looked). Also: the Shanghai to Hong Kong train only makes the journey every other day. Time wise; the train takes nigh-on 20 hours. But this isn't a major problem as the bulk of the time is overnight. As for the cost of tickets: there, probably, won't be a great deal of difference between the cost of a train and plane ticket (But you will save yourself 1 nights accommodation in Hong Kong).
At the moment; you can buy tickets 30 days in advance for normal trains. I'm not sure, however, if the same rule applies for the Shanghai to Hong Kong train. As for your other train tickets: If you cross back into the Mainland from Macau at Zhuhai, you will then have to get a train to Guangzhou (There are dozens of trains every day. You won't have to pre-book. Takes about 90 minutes). From Guangzhou; a fast train to Guilin takes between 2 and a half and 3 and a half hours (There are a good number of these every day as well. I'd risk buying on the day). You problem will be getting from Guilin to Hangzhou. There are trains, but the "fast" ones take the best part of 8 hours (And are seat only). Personally; I'd take an overnight train. There is one (T78) that leaves Guilin at 4:45pm and gets into Hangzhou at the very civilised hour of 7:52am the next day. It is, however, always best to pre-book sleeper tickets (Just in case).