Both are bonafide ATGs and as such, the difference between them is nonexistent. Easily among the three best test batsmen of their era, along with Sangakkara. If I was picking a 2010s' test team, Amla would bat at #3 and Younis would bat at #4 or #5.
Both have fantastic records all over the world, with Amla being especially brilliant against the big teams in their own backyards; averages 45 in Australia; 60 in England; 60 in India; and 70 in the UAE. Khan meanwhile, did something that many greats are unable to do so, score big hundreds away from home in the tail-end of their career. His 200 in England, 150 in Australia and 170 in Sri Lanka were scored when he was 35+ years of age.
Both of them have also dominated and bullied the best bowlers of their era and played countless match-winning and drawing innings and during their peak, were the best batsman of their side. It is no wonder that the new generation of cricketers is placing Amla and Younis in their all-time test XIs.
Amla, however, is a great ODI player as well and has even found success in the shortest format. Along with ABD and Kohli, he's been the best ODI batsman of his generation as well. That gives him the edge in this discussion but as far as the real format goes, there is nothing to separate between them. It has been a pleasure to watch both of them at the top of their game over the last decade.