Updating FFT algorithm accordingly when upsampling/resampling
Your whole problem is due to the fact that you have made a wrong assumption.

Increasing the sample rate does not increase the frequency resolution. It will increase the Nyquist frequency (the highest frequency you can represents) while keeping the same resolution. And that is exactly the phenomenon you have encountered with Matlab.

In other word, after upsampling by a factor of 10, your spectrum goes up to $2560 \text{ Hz}$, not $256\text{ Hz}$. I think you figured that out as the script you provided takes that in consideration while the figure you have posted does not.

In order to improve the resolution, you have to take a longer acquisition in time. 

Your frequency resolution is evaluated as :
$$R = \frac{F_s}{N}$$
Where :


$R$ is the resolution
$N$ your number of FFT samples
$F_s$ your sampling frequency


In the script you have provided, you did increase the sampling frequency by a factor of $10$, but you also increased the number of samples by the same factor. Thus, you kept the exact same resolution of $512/90000 = 0.568 \text{Hz}$.

In order to get a better (smaller) resolution you have to:


Increase $N$ without changing $F_s$. In other word longer acquisition
Decrease $F_s$ without changing $N$. In other word longer acquisition  


Hope that helps!