इन्द्र भगवान् is the most mentioned dEva in V Ramayana. Whenever Bhagavan Shri Rama is mentioned he's described in reference to Indra, far more than Bhagavan Vishnuji. From beginning to end in the Epic.
If Indra had not tested अहल्या Shri Rama wouldn't have got to make her alive back from stone and she wouldn't have been recognised as a पञच Kanya.
AFAIU/S Shruti are above itihAsa purANa so I'd always go with the depiction of Indra in the former than the latter.
Many would not like it but if anyone goes through पौराणिक texts, especially vaiShnava ones, they all equate Indra with their respective deities who happen to be described in image of Indra himself, in some texts at significant points Indra is even made seen as replaceable. There onwards the worship of Bhagavan Indra is seen in decline.
शैव texts do that with Prajapati/BrahmA.
Without making light of one deity another cannot be made prominent who is evidently mentioned as either the image of the former or described as taking over the function of the former.