Though usually it's slightly difficult to count on cheap discounted tickets when traveling on such short notice, but you actually might get lucky, especially in case you are a bit flexible. Let's look at each leg separately:
Budapest-Vienna: just checked and there is still quite a number of 13 euro tickets left for Nov. 7 and Nov. 8 departures (obviously not all the connections, but still you have a choice), so in case you visit like right now MAV website, you can easily buy discounted 13 euro tickets Budapest-Vienna. We also have a special guide on how to handle MAV website eShop -
http://europetrainsguide.com/Advice/How-to-Buy-Train-Tickets/Hungary-MAV.htmlVienna-Krakow: this one is more complicated, but if you willing to spend afternoon on the train, then you can still get discounted 39 euro tickets from OeBB website for Nov.10 And again we have a small guide to help you with the purchase -
http://europetrainsguide.com/Advice/How-to-Buy-Train-Tickets/Austria-OeBB.html In case you up for an overnight train, then it will be more tricky to travel cheaply, but still we can give a few tips, so let us know whether you've interested
Krakow-Prague: here you have a few options on how to travel for less money than full fare standard ticket price. Easier option is simply to "break" your ticket via border, idea is simple - instead of paying for the whole route Krakow-Prague under international tariff you first buy international ticket Krakow- first Czech station (Bohumin), while then you use cheaper Czech national ticket (in this case it will be Bohumin-Prague). Second ticket can be bought for the same train, so you won't even need to get off in Bohumin, but simply have two separate tickets for one journey - international Krakow-Bohumin (17 euro) and national Bohumin-Prague (330 CZK, this one can be bought online from Czech Railways
eShop and you print it yourself). More complicated, but cheaper option, which as well as the previous one works both for the overnight or daytime journeys, is to catch first bus Krakow-Cieszyn (roughly 3 hours and 20 PLN), Cieszyn is a small town on the border of Poland and Czech Republic (see google maps), from there you can simply walk to Czech side by foot (<2 km). From Czech side (Cesky Tesin) you can catch train to Prague (from 400 CZK)
Also you can skip Vienna at all, then just visit MAV website and purchase discounted tickets (from 39 euro) for the direct overnight connection Budapest-Krakow, journey is a bit long (11 hours), but 39 euro for couchette carriage is good price here
p.s. there is also a few options involving buses (like Eurolines for Budapest-Vienna or PolskiBus for Vienna/Bratislava-Poland), but buses are buses, so we advice you first to look at train options and only then, if those somehow not for you, check out bus options