तेन गन्धर्व यक्षाणाम् देवतानाम् च रक्षसाम् |
अवध्योऽस्मि इति वागुक्ता तथेति उक्तम् च तन् मया || १-१५-१३
"Ravana said while seeking boon that, 'I shall not be killed by gandharva-s, yaksha-s, or by gods, or by other demons...' and I also said 'so be it..." [1-15-13]
Looks like Ravana didn’t ask for immunity from the trimurtis who are not really devas.
When Ravana was attacking Devaloka, Indra asked Vishnu for help in fighting Ravana. But Vishnu refused, saying that Ravana had a boon that he couldn't be killed by any god, but that he would soon incarnate on the Earth as Rama to defeat him:
“Do not fear, hear what I have to say. He is invincible by virtue of the boon, and that vicious-souled one is incapable of being vanquished even by the celestials and Asuras. Irrepressible by virtue of his prowess, that Rakshasa, with his son, shall accomplish a mighty object. O lord of celestials, even if I am requested by thee, I shall not withstand the Rakshasa, Ravana in the conflict”
Vishnu seems to think Ravana had immunity from him.