As bitcoin stands at the moment, a standard orphan race is decided simply by the first block received above the ‘current’ height - of course this process can continue if both forks grow at the same rate, but the concept and the solution are the same for multi-block forks up to a point When the orphan is resolved by the ‘higher’ block found, if that block is on a different valid fork to the what bitcoin considers the current fork, it will simply switch to the other fork.
It would be very useful to have an RPC command to switch which fork bitcoin considers is the current fork - probably by choosing the block hash at the top of the fork, if bitcoin knows multiple forks at the same height In the case of network issues about choosing a fork, this would provide a very simple method to resolve which side of the fork a miner using bitcoin is mining on. This would of course add complexity and require a different command if the fork chosen was at a lower level, but that could also be handled by being able to state that a specific block (in a fork) is invalid and should be ignored - and thus give a method to effectively invalidate the fork.
I’m not sure what the RPC submitblock does with a block when it receives one, on or creating a different fork, but of course it would need to accept a block on a different fork if it doesn’t already.