I've done both. There is no train Dali-Lijiang, so you only have a decision to make on the Kunming-Dali route. The train is a very convenient overnight, and the scenery is nothing much to see from Kunming to Dali, so you should certainly take the train (or fly). Dali-Lijiang passes by some very nice scenery - better still is the way up to Hutiaoxia/Tiger Leaping Gorge, where you'll pass by the 18000-something foot tall Jade Dragon Snow Mountain (Yulongxueshan). You can easily book a driver (either van or private car) in Dali to bring you up.
The other option, as noted, is to fly. You can even fly all the way to Zhongdian and then return to Kunming via road/train (or head north on a *really* scenic road to Deqin near the Tibet border, surrounded by 20k foot mountains.