Ravana was not liberated or didn't go to heaven after being killed by Śrī Rāma. He was born again as Śiśupāla in the 28th Dwapara Yuga.
Ravana was rebirth of one of the gatekeepers of Vaikunta. He was the Rebirth of Jaya. Vijaya was born as Kumbhakarna.
This was due to curse of Sanat Kumaras given to Jaya and Vijaya. According to that curse, they are born as Rakshasas for three lives.
The Lord replied: O brāhmaṇas, know that the punishment you inflicted on them was originally ordained by Me, and therefore they will fall to a birth in a demoniac family. But they will be firmly united with Me in thought through mental concentration intensified by anger, and they will return to My presence shortly. Śrīmad-Bhāgavatam 3.6.26.
They were separated from the Lord for three births.
While Jaya and Vijaya, thus cursed by the sages, were falling to the material world, they were addressed as follows by the same sages, who were very kind to them. “O doorkeepers, after three births you will be able to return to your positions in Vaikuṇṭha, for then the duration of the curse will have ended.Śrīmad-Bhāgavatam 7.10.39
- The gatekeepers Jaya and Vijaya were born as Hiraṇyākṣa and Hiraṇyakaśipu respectively. Lord Vishnu killed Hiraṇyākṣa in the incarnation of Varāha and Hiraṇyakaśipu by incarnationg as Narasimha.
- Jaya as Rāvaṇa and Vijaya as Kumbhakarṇa. Both of them were killed by Lord Rāma.
- Jaya as Śiśupāla and Vijaya as Dantavakra. They were slain by śrī Kṛṣṇa effortlessly.
Thus the two associates of Lord Viṣṇu who had become Hiraṇyākṣa and Hiraṇyakaśipu, the sons of Diti, were both killed. By illusion they had thought that the Supreme Lord, who is situated in everyone’s heart, was their enemy. Being cursed by the brāhmaṇas, the same two associates took birth again as Kumbhakarṇa and the ten-headed Rāvaṇa. These two Rākṣasas were killed by Lord Rāmacandra’s extraordinary power. Śrīmad-Bhāgavatam 7.10.35-36.
They both took birth again in human society as Śiśupāla and Dantavakra and continued in the same enmity toward the Lord. It is they who merged into the body of the Lord in your presence. Śrīmad-Bhāgavatam 7.10.38.
Rāvaṇa was reborn as Śiśupāla, as the son of Damaghosha, king of Chedi kingdom. Śiśupāla was killed by Lord Kṛṣṇa in the third birth. He was killed during the Rajasuya yaga when he insulted Kṛṣṇa.
The killing of him was explained in detail in SECTION XLIV of Sabha Prava the Mahabharata. You can read it there in detail.