Airline policies vary - old-timers may remember when Delta pre-Skymiles gave a class-of-service bonus based on where you sat, not what you paid - but that's the general rule. To be absolutely certain, check the specific airline you care about, either with it directly (most have this information on their Web sites) or in that airline's forum here on FT.
Also, when there's a problem with your original flight and you're rebooked on another, information about what you originally paid for an upgraded ticket isn't always transferred. There are many reports of people receiving credit for paid travel in the upgraded class when this happens. However, it's not something you can count on.