Here are upper boundsoptimal solutions for $n \le 10$, and the two sets happen to be equicardinal even if you don't enforce that: \begin{matrix} n & a_n & \text{solution} \\ \hline 1 & 1 & \{2\},\{1\} \\ 2 & 2 & \{2,3\},\{1,4\} \\ 3 & 6 & \{1,5,6\},\{2,3,4\} \\ 4 & 18 & \{1,5,6,7\},\{2,3,4,8\} \\ 5 & 30 & \{2,3,4,8,10\},\{1,5,6,7,9\} \\ 6 & 576 & \{1,4,7,8,9,11\},\{2,3,5,6,10,12\} \\ 7 & 840 & \{2,4,5,6,8,11,14\},\{1,3,7,9,10,12,13\} \\ 8 & 24480 & \{1,5,6,7,8,13,14,15\},\{2,3,4,9,10,11,12,16\} \\ 9 & 93696 & \{2,3,6,8,9,11,12,13,18\},\{1,4,5,7,10,14,15,16,17\} \\ 10 & 800640 & \{2,3,4,8,9,11,12,18,19,20\},\{1,5,6,7,10,13,14,15,16,17\} \\ \end{matrix}
I obtained these via integer linear programming by instead minimizing the difference in log products (sum of logs) rather than difference in products, but this problem is somehow not quite equivalent, as shown by $24480$ for $n=8$ rather than the correct(?) minimum value of $3712$.