I think the entitlement for the first leg applies to the whole trip (which can work in or against your favor). So the upgrade on the second leg, unfortunately, does not matter (to the best of my knowledge).
I believe that this is true even if your trip has segments on different airlines/alliances.
It can lead to bizarre/unfair situations. For example if your first segment does not have a premium cabin and you connecting to a segment with a premium (paid) cabin. Or say you connect from an alliance with which you have status to an alliance with which you do not have status.