Former England opener Alex Hales became the second-highest run-scorer in T20 history but was on the losing side as Dubai Capitals beat Desert Vipers to reach the final of the International League T20.