It means mankind.
The world Aalamin gives its meaning in its context. for example, Bani Israel were given favour against the peoples of their time. This is termed as Aalamin
بَنِي إِسْرَائِيلَ اذْكُرُوا نِعْمَتِيَ الَّتِي أَنْعَمْتُ عَلَيْكُمْ وَأَنِّي فَضَّلْتُكُمْ عَلَى الْعَالَمِينَ
The prophet Lot mentions it in the same context which means the peoples around them in their knowledge:
وَلُوطًا إِذْ قَالَ لِقَوْمِهِ أَتَأْتُونَ الْفَاحِشَةَ مَا سَبَقَكُم بِهَا مِنْ أَحَدٍ مِّنَ الْعَالَمِينَ
So in the above-cited verse, the prophet Muhammad was sent as mercy to mankind, since his message is a scource of mercy to them that is why the prophet is a mercy to them. Sicne his mercy by no means limited to the people of his time only, therefore he is the source of mercy for all the mankind till the day of judgement.