The best would be flying, the cheapest hitch-hiking ;-)
But seriously, I think that there is no direct flight to Budapest from Krakow airport or from nearby Pyrzowice airport. But there is direct night train:
Kraków Główny 30.01.10 leaves at 22:11 (10:11 p.m)
Budapest-Keleti pu 31.01.10 arrives at 08:32 a.m.
(it suppose to be everyday train)
PS. it says that it is train with couchettes only. Personally I used that kind of train once travelling from Wroclaw (Poland) to Berlin. It was quite long journey, but I just fall asleep in the evening and woke up in the morning. It was quite comfortable and I think quite safe.