The rules in this scenario are pretty straight forward (well at least as straight forward as the RRS get)...
11 ON THE SAME TACK, OVERLAPPED
When boats are on the same tack and overlapped, a windward boat
shall keep clear of a leeward boat.
Keep Clear A boat keeps clear of a right-of-way boat
(a) if the right-of-way boat can sail her course with no need to take
avoiding action and,
(b) when the boats are overlapped, if the right-of-way boat can
also change course in both directions without immediately
If she establishes an overlap from clear astern, then the onus is entirely on the windward boat to keep clear of leeward. No ands, ifs, or buts, the windward boat is going into no-man's land if she puts herself in that position and she must keep clear.
16 CHANGING COURSE
16.1 When a right-of-way boat changes course, she shall give the other
boat room to keep clear.
Room The space a boat needs in the existing conditions, including space to
comply with her obligations under the rules of Part 2 and rule 31, while
manoeuvring promptly in a seamanlike way.
If the leeward boat changes course (luffs), she has to give the windward boat room to keep clear. She can not slam her boat head to wind, but she can turn to windward quickly and the windward boat is still required to keep clear. If the leeward boat can not turn to windward to luff without immediately contacting the windward boat, then the windward boat has fouled leeward.
The leeward boat may force the windward boat to head to wind, but she may not force the windward boat beyond head to wind (force her to tack), although the windward boat may choose to tack in order to escape from the leeward boat.
If the windward boat tacks, then rule 13 kicks in:
13 WHILE TACKING
After a boat passes head to wind, she shall keep clear of other boats
until she is on a close-hauled course. During that time rules 10, 11 and 12 do not apply. If two boats are subject to this rule at the same time, the one on the other’s port side or the one astern shall keep
In essence, a boat which is tacking is required to keep clear of one which is not, so the previously windward boat would still be required to keep clear.