It may not be necessary an upgrade.
For example, In the above case the passenger would have applied for HO quota and if the HO in Sleeper would have exhausted and if the berths were available in 3A/2A, then a new PNR gets generated and the berth's are allocated accordingly in other class.