I'm not sure that this is the best approach, but I think that it is a correct approach. Assume that x1 and x2 are each bounded by M, so |x1 - x2| <= 2 M. Define two binary (Boolean) variables y1 and y2 as control variables. Tie them to the optimization as follows:
x1 - x2 - 2*M*y1 <= 0;
x1 - x2 - 2*M*y1 >= -2*M + 1
x2 - x1 - 2*M*y2 <= 0;
x2 - x1 - 2*M*y2 >= -2*M + 1
y1 + y2 >= 1;
The first constraint ensures that y1 = 1 whenever x1 > x2. The second constraint ensures that y1 = 0 whenever x1 <= x2, so these two constraints together ensure that y1 is the indicator function that x1 > x2. The third and fourth constraints are the parallel to the first, and ensure that y2 is the indicator function of x2 > x1. The last constraint ensures that at least one of y1 and y2 is 1.
I think that this is correct, but I am not sure that it is the most efficient formulation. Might as well give it a try and see.
MATLAB mathematical toolbox documentation