Using your notation, one can work explicitly as follows. Let $s_A = \sum_{i \in A} |x_i - y_i|$ and $s_B = \sum_{i \in B} |x_i - y_i|$. Then $$\displaystyle s_A - s_B = \sum_{i \in A} (x_i - y_i) - \sum_{i \in B} (y_i - x_i) = n - n = 0,$$ hence $s_A = s_B = s$. Note that $s \leq n$ (this cannot be improved by much in general: say $x_1 = n, x_i = 0$ for $i = 2, \cdots, n$ and $y_i = 1$ for $i = 1, \cdots, n$). Thus by your AM-GM argument one gets $$\displaystyle \prod_{i = 1}^n |x_i - y_i| \leq s^n (n-x)^{x-n} x^{-x}$$ for $x = |A|$. The latter function can be optimized to give an upper bound of $(2s/n)^n$. This is slightly better than the bound given by Denis Serre, which takes the value $s = n$.