Before I came to Brazil I always wondered what would work best as I don't speak Portugese but speak an advanced level of Spanish. So, would they understand me more if I spoke Spanish (because it's similar to Portuguese) or if I spoke English? Well after 2 weeks in Brazil I think I found the answer...in short, Spanish is usually better but English occassionally is. There was more English in Rio or Sao Paolo for example, and less in Salvador and Praia de Forte (even in the tourist information office). In a mid range hotel or high end restaurant I would try English first, in most places e.g. a low end hotel or street food vendor or non-tourist shop just go straight for Spanish.
For the most part, people did understand me in Spanish, even with some concepts that were not that simple. For example I went into a pharmacy and said that I had too much ear wax and wanted a liquid drop treatment to soften the wax so it would fall out. That was understood. However, a little tricky concept like that would be hit and miss. Very basic things "I want to buy x" would work more often than not. I tried to speak slowly, and repeat things two different ways if possible.
Of course, understanding what they say in response was more tricky, and requires being really alert and thinking outside the box in real time to run through the possibilities of what they might be saying by cross refrencing with Spanish and English as they talk. The difference in pronunciation means that generally, I cannot understand spoken Portugeuse, even though I can make a good stab at reading it. With experience, I was improving, but very slowly.
I did learn a few words in Portuguese of course, like Obrigado, as a courtesy. I also realized that, hypothetically, if I were to move and live in Brazil, I would speak Portugese by speaking Spanish and over time replacing more and more words with the Portugese one. That would, inevitably, be the way to do it.
Of course, I am assuming you really can speak Spanish to a good level not a basic level. Obviously if your Spanish is barely intelligible in a Spanish speaking country they you've got no chance in Brazil!

