Vishnu and Shiva are regarded as two of the ultimate Godheads in Sanatana dharma and they both revered as the Ultimate Vanquishers of Demons. However, Are there any instances in Puranas where certain demons (Asuras) are shown to defeat even Vishnu or Shiva in a battle? If yes, which puranas mention these anecdotes and which asuras are shown to defeat Shiva or Vishnu?
Yes, There are some Asuras who, in the Purana texts, are shown/stated to have bested either Shiva or Vishnu, or even both in battle.
Here is A list of a few such Asuras.
Is said to have defeated Maharudra (Shiva) as per Bhavisya Purana
ब्रह्मकल्पे पुरा चासीत्तालजंघान्वयोद्भवः । मुरो नाम महादैत्यो ब्रह्मणो बलदर्पितः । । 3.4.16.३० ब्रह्माण्डेशं महारुद्रं महेन्द्रादिसमन्वितम् । स बभूव पराजित्याधिकारी रौद्र आसने । । ३१
During Brahmakalpa, Daitya Mura even conquered the Lord of the Devatās, Śrīman MahaRudra alongwith Indradi devatas by virtue of Brahma's boon.
~ भविष्यपुराणम् /पर्व ३ (प्रतिसर्गपर्व)/खण्डः ४/अध्यायः १६
Is Stated to have defeated Rudra alongside indradi devas as per Vamana purana.
~ Vamana Purana, Chapter 17
Is stated to defeat Brahma, Vishnu as well as Mahesvara as per Skanda purana and Devi Bhagavatam.
Formerly there was a notorious Dānava Mahiṣāsura with a huge body in Kṛta Yuga. He caused terror unto the Devas. He was killed by the Trident-wielding Goddess. His body was pierced with the spear. It was this powerful Asura who, in Kṛta Yuga, defeated eleven Rudras, (twelve) Ādityas, along with the group of (forty-nine) Maruts, (eight) Vasus along with Moon-god and Sun-god. He defeated Brahmā, Viṣṇu and Maheśvara. When the terror of the Devas was thus killed in a fierce battle, Goddess Nandā of wide eyes, after the terrible slaughter, took her bath in the Hrada (pool).
~ Skanda Purana, Āvantya-khaṇḍa, Revā-khaṇḍa, Chapter 140
1-3. Vyāsa said :-- O King! Mahiṣa seeing the Dānavas afflicted with grief, quitted his buffalo appearance, assumed a lion form and spreading this long manes began to roar aloud and fell amidst the Deva forces; then the Devas were terrified on seeing his sharp nails. That lion-form Mahiṣa first attacked so severely the Garuḍa with his nails, that his whole body was besmeared with blood; then he attacked Viṣṇu’s arms with his nails.
4-11. Seeing the Dānava, Vāsudeva Hari raised his discus in anger and attacked him with great force to kill him. Just when Hari struck the Dānava violently with his Cakra, the powerful Dānava quitted immediately his lion-form, assumed the buffalo form and struck Hari with his two horns. Vāsudeva, thus pierced in his breast with the horns, became confounded and fled away as best as he could till he reached his own abode, Vaikunṭha. Seeing Hari thus fleeing away, Śaṅkara, too, thought him invulnerable and fled to his Kailāśa mountain with fear. Brahmā, too, fled to his own abode with terror; but the powerful Vāsava took patience and remained steady in the battle.
~ Devi Bhagavatam, Book 5, Chapter 7
Is stated to have defeated Rudra as per Padma purana and Vishnu as per Matsya Purana.
106-108a. However, the missiles did not cling to his body resembling thunderbolt and a mountain. Then having jumped down from his chariot, Tāraka, the king of the demons, hit crores of gods with his hands and kicks. The armies of gods, that escaped being killed, being afraid, and having given up weapons, fled in (various) directions.
108b. Seeing the gods fleeing, Tāraka said (these) words:
- “O demons, do not kill the gods. Tying them, bring them quickly, and show them to Vajrāṅga. Let him see gods.”
110-112. Then the demon, being praised by Diti’s sons and well-served by the celestial damsels, having tied, in the battle, the regents of quarters led by Indra and with Rudra, with strong bonds, as a herdsman leading the beasts, again went, after getting into his chariot, to his own house, beautified with Siddhas and Gandharvas, and having a top like the Vipula mountain.
~ Padma Purana, Sṛṣṭi-khaṇḍa, Chapter 42
ततो रथादवप्लुत्य तारको दानवाधिपः। जघान कोटिशो देवान् करपार्ष्णिभिरेव च ।। १५३.२२३ हतशेषानि सैन्यानि देवानां विप्रदुद्रुवुः। दिशो भीतानि सन्त्यज्य रणोपकरणानि तु ।। १५३.२२४ लोकपालांस्ततो दैत्यो बबन्धेन्द्रमुखान् रणे। सकेशवान् दृढैः पाशैः पशुमारः पशूनिव ।। १५३.२२५
Afterwards, Tarakasura alighting from his chariot belabored billions of Devas with his fists and blows and heels. Then the remainder of the army of Devas abandoning the field, flew in every direction with horror. The demon then captured Indra and the Lokapalas and tied down Keshava (Visnu) etc. as a hunter takes hold of the wild beasts.
~ Matsya Purana Chapter 153
Is stated to have Defeated Narayana (Vishnu) as per Skanda purana.
20-23. On hearing the words of the Devas, Vāsudeva, Janārdana, Keśava fought a battle with him for a hundred years. Extremely powerful due to the boon (of Śiva) he vanquished Nārāyaṇa. On being conquered by Lohāsura, Lord Nārāyaṇa invoked again and again Rudra and Brahmā. There was another attempt after their consultation as the body of Daitya Lohāsura became fresh. The next fight between the Daitya and Keśava was very fierce.
~ Skanda Purana, Brāhma-khaṇḍa, Dharmāraṇya-khaṇḍa, Chapter 29