Compare two files with awk or sed
This sed solution might work for you:
{ seq 1 10; echo -e "2 yay\n3 ups\n4 wow\n8 hey"; } | sort -n | sed '1{h;d};H;${x;s/\(\S\+\)\n\1[^\n]*\n//g;p};d'1567910
Explanation: Sort the files numerically then using sed
slurp the file in to the hold space (HS). At end of file swap to the HS and then delete lines with the duplicate keys.