The train might be more interesting than a boring old plane! Trains go every other day to either Beijing (23.5 hours (18.5 hours) or Shanghai. You can go by hard sleeper which will be quite crowded or pay a bit more for a soft sleeper in a compartment with 2 or 4 berths.
The "normal" visitor would opt for a flight. Trains are for visitors who like something different.
A hard sleeper is uncomfortable and crowded.
There is also now the option of daytime high-speed trains, leaving from Shenzhen and traveling to Shanghai. This is quite new, and I haven't done it yet myself, so I can't vouch for the comfort or scenery.
If taking the night train, the soft sleeper would be my preference.
How easy is it to travel in China? Do hotels understand most languages such as English? Do hotels offer mini tours as European Hotels do?
Back to the original question, your options are to fly from HK to Shanghai, take a long overnight train from HK to Shanghai (train runs on alternate days), or cross the border to Shenzhen and take a fast train to Shanghai. And Mercier is wrong, trains are not crowded, they only sell as many tickets as there are seat and these new fast trains are quite comfortable.
@van k - start your own thread. Your topic is unrelated to what is being discussed here. Chinese hotels do not speak "most languages". Only Mandarin and some English. Rarely others.
If time is not a critical factor, then a train ride should be quite interesting. The high speed trains are clean and comfortable.
Personally I would recommend a flight.
I don't think there is huge difference in costs. Whatever appeals to you is the right choice.
Will it be difficult for me to get train tickets in HK? I was thinking of buying the train ticket to Shanghai when I reach HK on 26th March