Who owes mark-room is fixed when the first boat reaches the zone: if they are overlapped, the outside boat owes it; if not, the boat that is not yet in the zone owes it. That stays true even if the overlap later changes.
Rule 18.2(a)(1) — the boats were overlapped when the first reached the zone of mark1 and boat1 was inside, so boat2 gives boat1 mark-room.
Uses how the boats stood when the first one reached the zone.