Another factor you might consider is that it will be a bit easier to return to Prague than to Krakow. I'm very interested in 20th century history, so for me five days is very, very little time to split between those cities. If I had just five days I'd spend all of it in one of those cities rather than splitting my time, but I am an acknowledged slow traveler.
My experience with night trains is that I don't get a lot of sleep on them. The Krakow-Prague night train makes a lot of stops, each one of them accompanied by braking, station noise, then acceleration. Are you sure you'll enjoy yourself the next day, as opposed to being dead on your feet?
Krakow Glowny dep 22:33
Oswiecim dep 23:53
Brzeszcze Jawiszowi. dep 00:15
Czechowice-Dziedzice dep 00:40
Zebrzydowice dep 01:11
Bohumin dep 03:33
Ostrava hl.n. dep 03:43
Ostrava-Svinov dep 03:51
Olomouc hl.n. dep 04:46
Ceska Trebova dep 05:41
Pardubice hl.n. dep 06:20
Praha hl.n. arr 08:21
As you can see, the longest period without a stop is just 2 hr. 22 min.