In The Lord of the Rings: The Return of the King, the Men of the Mountains, better known as the Dead Men of Dunharrow (Oathbreakers), were not actually cursed by Isildur, nor did the One Ring have anything to do with their fate. 💀
The Men of the Mountains had sworn an oath to aid Isildur against Sauron. In Middle-earth, such oaths were often made in the names of the Valar and sometimes even Eru Ilúvatar Himself. When they broke that oath, they became Oathbreakers, bound by a sacred vow they could not escape.
Importantly, Isildur did not possess the power to prevent Men from passing beyond the world after death. Not even Manwë or Námo Mandos could alter the fate of Men, as that authority belonged to Eru alone. The Dead Men of Dunharrow remained in Middle-earth because Eru ratified the oath and its consequences through Isildur's words.
The One Ring had nothing to do with their fate. It was not the power of Isildur, nor the power of the Ring, that bound them to the world. It was the power of a broken oath sworn before Eru Himself.
However, this was not a permanent curse. Centuries later, after fulfilling their oath to Aragorn, Isildur's heir, the curse was lifted and their spirits were finally allowed to rest.