tāṁs tathāvasitān vīkṣya
yajñaḥ sarva-gato hariḥ
yāmaiḥ parivṛto devair
hatvāśāsat tri-viṣṭapam
tān - the demons and Rākṣasas; tathā - in that way; avasitān - who were determined to devour Svāyambhuva Manu; vīkṣya - upon observing; yajñaḥ - Lord Viṣṇu, known as Yajña; sarva-gataḥ - who is seated in everyone's heart; hariḥ - the Supreme Personality of Godhead; yāmaiḥ - with His sons named the Yāmas; parivṛtaḥ - surrounded; devaiḥ - by the demigods; hatvā - after killing (the demons); aśāsat - ruled (taking the post of Indra); tri-viṣṭapam - the heavenly planets.
The various names of the demigods — Lord Brahmā, Lord Śiva, Lord Indra and so on — are not personal names; they are names of different posts. In this regard, we understand that Lord Viṣṇu sometimes becomes Brahmā or Indra when there is no suitable person to occupy these posts.