If the X on the right decides to Withdraw, then O gets the free attack on him instantly, before he moves out of range. O doesn't need to move at all.
And, in fact, he probably can't, because it's not his turn. When the X's turn is done, then the O can Withdraw from the left X to chase after the right X. However, Withdrawing uses up his Action so he won't be able to attack the right X on that turn even if he catches him.