Can climbing above RVSM airspace cause temporary loss of separation with an aircraft in RVSM airspace?
I think the way rules regarding RVSM are worded in ICAO documents leaves some room for interpretation. When RVSM was implemented, it was probably not very common for aircraft to be able to climb above FL400, so this specific problem was probably not considered when writing the rules. But I would say, when in doubt, use the more conservative interpretaion, which would be that: Yes, this would be a loss of separation.
It sounds weird that increasing the distance between two aircraft can cause a loss of separation, but RVSM airspace is not actually the only place where this can happen. I can think of a few other examples:

Two aircraft flying on parallel tracks with exactly 3 NM between. They are flying parallel to an airspace border. On one side of the border, the required separation is 3 NM, on the other side, the required separation is 5 NM (this is quite a common setup, actually). Imagine one of them is flying almost directly on the airspace border. If this aircraft now turns slightly away from the other one, increasing the distance between the two, it crosses the border into the airspace where 5 NM of separation is required. That's a loss of separation.

Losing lateral separation when no other separation exist. For example, imagine a visual reporting point 1.5 NM from the runway. In the local rules, it is defined that VFR traffic orbiting overhead this reporting point are separated from aircraft taking off and landing. When an aircraft takes off whild a VFR flight is orbiting over this point, that's all well and good. By definition, they are separation. But if the VFR flight now leaves the reporting point, separation may be lost - even if the VFR flight takes a heading directly away from the other aircraft, so the physical distance is increasing. As the VFR flight leveas the reporting point, the rule about lateral separation no longer applies, so if the flights are closer than the prescribed radar minima, that's a loss of separation.

Two aircraft taking off after each other. Initially, the tower controller can visually see both aircraft and ensure separation. When the controller can see both aircraft, normal minima do not apply - it is up to the controller to visually make sure there is no risk of collision. Now imagine the first aircraft climbs into a cloud, so the controller can no longer see it. Even if the higher aircraft is climbing faster than the lower one, so physical separation is increasing, if the required vertical separation does not exist when the controller loses visual contact with the first aircraft, that's a loss of separation.

Two aircraft flying on opposite, parallel tracks. The required radar separation is 3 NM for aircraft flying less than 250 knots, and 5 NM for aircraft flying faster than that. Both flying at 250 knots, they pass each other with exactly 3 NM in between, and are now flying away from each other. One aircraft now accelerates to 251 knots, while there is still less than 5 NM between them. Although they are rapidly moving away from each other, that would be a loss of separation.


These are all real examples that, although they shouldn't happen, could result in a loss of separation between two aircraft that were initially separated, while distance between them actually increases. I think the key point here is the fact that in each example, the rules regarding separation minima change, which is what causes the loss. A rule that allowed the aircraft to be relatively close together, for one reason or another, no longer applies, and so we have to fall back to another rule, which may require larger minima.
While this may not specifically answer your question regarding RVSM, I think the exact same logic can be applied. In your example, initially, one rule applies: RVSM, which allows 1000 ft vertical separation. As aircraft B leaves RVSM airspace, the RVSM rule no longer applies, so we have to fall back to the general rules for vertical separation, which says we need 2000 ft. Thus, your example would indeed be a loss of separation.