I live in Brazil, so if the government defaults, every other investment I could have made here would also crash, and the local economy with them. It's not called the "risk-free" interest rate for nothing: it's the lowest risk investment one can get within Brazil. Corporate bonds, for instance, will have a higher return, due to their higher risk.
As for inflation, when it increases the SELIC/CDI rates tend to rise with it too. And if you're afraid of that (it hasn't been long since we had a hyperinflation, so a lot of people still are), another government bond (NTN-B) has a return of inflation (measured by the IPCA index) plus a pre-fixed component (currently around 6%). Due to its pre-fixed component, it has some interest rate risk (if the interest rate rises, its present value drops, and vice-versa), but that's not a problem if you intend to keep it to term.
And, actually, the high interest rate is set by the government, as a way to control the inflation, so it's not as linked to the risk of default as one might think. The government could decide to lower the interest rate (and it has: a few years ago, it was set lower, but that led to the currently higher inflation, so the government increased it again to contain the inflation).