One thing to note about this train, several thefts from tourists have occurred on this route, occasionally with compartment gassings. As long as you keep your compartment door locked, you should be fine. The problems tend to happen after/before the Polish border crossing when the train makes numerous stops at little stations, where it is easy to jump on/off the train. I've done this trip several times and have never had an issue, the only really annoying thing are the frequent stops at border crossings. Enjoy both Krakow and Budapest!