According to the Bhagavad Gita, a self-realized person is one who has gone beyond fear, anger, hatred, jealousy, pain and pleasure, etc. and all dualities of the material world. AKA he is situated in Brahman and not disturbed by illusion or Prakriti. 

In the Upanishads we see Devas teaching other people how to become self-realized: Indra teaches Pratardana, Varuna teaches Bhrigu about Brahman etc.

Assuming Devas are self-realized, why then do they and Rishis do things that are not characteristic of those who are self-realized? Indra seduces Ahalya, attacks Vrindavan because they didn't worship him, etc. Rishis curse other people when they get angry, etc.

I remember reading that this concern is also mentioned in the Brahma Sutras in chapter 3, but forgot where exactly. The response was that Devas and Rishis, although self-realized, act this way because they are in a position which requires them to.

Is this correct?