That's a really good question and I'm sure a lot of Brazilians would like to know the answer.
As it is, you could argue that Brazil is ahead of China. Brazil's GDP per capita is well ahead of China's though China is growing much faster.
I don't think that the problem with Brazil is that it is dependent on natural resources. After all, services make up two-thirds of its economy, which puts it closer to the US in terms of the composition of its economy (the US has services making up 76% of its economy) than to China (where services are only 43%). Instead, I think that the problem may be that Brazil might be hitting the "middle income trap."
I think that Brazil's main challenge is to figure out how it gets out of this trap. We will see if China will hit the same trap in the near future.