as for the flights within BRazil, with TAM you can get a 100€ flight to Cuiabá via Sao Paulo on 20. june if you are quick. there are no direct flights from RJ to Cuiabá.
in Cuiabá there are a couple of budget options with good service for accomodation, like the Gran Odara, Hits Pantanal (close to airport), Mangabeiras, Sansaed, Mato Grosso Palace, between 50 and 80€ for a room. some hostels too if you are more low-key, like the Ecoverde and Pantanal Hostel, with 30€ stuff. if you are into sights and hiking, the city itself doesn't deliver much from that point of view and the Pantanal which is awesome you might not have enough time for it, but there is the Chapada do Guimaraes north of town which is an awesome place to visit, 1-2 days is enough for that one and you can enjoy the southern end of the Amazon region by doing so.
flights from Cuiabá to Salvador, no direct flights with TAM, but via SP again, as I can see they are only from 125€ on 24. june for example.
if you are there, you might wanna stay at Catharina Paraguacu Hotel in Rio Vermelho neighbourhood (not far from airport, stadion and nightlife, is quite a safe place too) is a good option at medium price (80€) and I can really recommend it from own experience, but there are cheaper options too, like Pedra da Concha, Golden Park, Pousada Noa-Noa, Vila Velha, Jaguaribe Praia, Atlantico.
dunno if you are already booked at a RJ hotel and dunno about your budget either, first choice would be Ipanema or Leblon to stay but the places there are all very pricey. if you plan to spend less on that, you might wannna end up in a hotel in Catete, Flamengo, Botafogo, Urca or Santa Teresa. there are dozens of them.
you may ask me about any further info if you want, can recommend you good places to stay at any price level, to eat and visit at all of those places.