Use the `-n` option to sort numerically:
sort -k1,1 -k2n nameslist.txt
There is no need to use `cat` to read the input file. `sort` will do that without needing another process.
The `-k1,1` notation sets the start and stop limits of the first sort key to the first field.