References of Devas like Indra, Varun, Agni etc. doing severe tapasya to seek extra ordinary powers/boon in order to counter attack Asuras.
Yes in in Brahmanda Purana there is a story of Indra and all the devas performing a penance at the slopes of Himalaya in order to defeat Asura leader Bhandasura and all the other asuras , Who is later Killed By Devi Lalitha an incarnation of Shree Adi-Parashakti in a battle.
Brief Account of the Story -:
When Bhandasura got the boon from Lord Shiva that half of his opponents power in the battle will be united with himself and his arrows will make the opponents missiles and weapons futile.
He became powerful after receiving the boon and became the leader of Daityas. He performed all the Vedic activities and tapas for sixteen thousand years. Now he was becoming more powerful than the devas day by day. Indra got worried about the increasing power of Asuras and due to his deteriorating condition. Lord Vishnu by seeing Asuras influence and possibility of them of conquering three worlds created Maya and asked her to enter into the demon and thus Asuras were deluded.
Once Narada visited Indra and told him that Lord Vishnu's maya is residing in Demon Bhandasura , if he is somehow liberated from this maya he will overcome the three worlds. And this task cant be carried out without the help of Adi-Parashakti (supreme goddess) .And Asked him to do penance to get the help of the goddess in defeating him. So Indra with all the gods did the penance at Himalaya. They did the penance for Ten Thousand and Ten days.
43 Accompanied by all the devas he made due preparations for penance
and went to the slopes of Himavan.
44 Along with all the gods he performed the great worship of
Parashakti on the bank of Bhagirathi that was brilliant with flowers
in everyone of the seasons. Even since then that place bestowing all
sorts of accomplishments came to known by the name Indraprastha.
45-46 In accordance with the procedure advised by the son of Brahma ,
they performed the excellent and great worship of the goddess.They
were engage in Japa (repetition of holy names and mantras) and
mediation .They were steadyfast in severe penance without turning
their mind or attention on anything else. Thus ten ten thousand years
and ten days passed by.
Chandogya Upanishad is also having an interesting story in it about Indra and Virochana approaching Brahmadeva to know the nature of the self -Chapter 4: An Analysis of the Nature of the Self , It is mentioned in that Lord Brahma asked Indra to perform Tapas /penance many times ,when he was having some doubts about what is Atma or self i.e. to learn the truth about the Atman
So indra in total did one hundred and one years of tapasya in the abode of Prajapati while he was clearing the doubts about Atman or the Self.
And its because of this true knowledge of the self Indra and devas gained many victories in battle against Asuras.
Your other question basically enquires about how Devas were defeated by Daityas and how they have fled many times form the war to take shelter to Trimurtis.
"It appears that if they can not defend themselves then how come they
can defend others? It appears as if Asuras were more powerful and
competent than the Devas."
But it is not the case every time. As said by you the Asuras by their individual Tapas or penance satisfied /pleased either one of the Trimurti ( Brahma- Vishnu-Mahesha) and obtained peculier boon so that they can not be defeated or get killed in normal situations. And those asuras then became the leaders of Asura race and due to their boon they and their followers were able to defeat gods many times in battles. As the boons were given by the Trimurtis the Gods naturally went to them for the alternate solution to overcome the troubles caused by the Asuras and in the meantime not to override the boon given by Trimurties .
Mahabharata also tells us something different . In Adi Parva- Amsha Avataraana parva-Chapter 64 -Verse 28- it is mentioned that previously in Satya-Yuga Devas (sons of Aditi) defeated Daityas many a times.
आदित्यैर्ही तदा दैत्या बहुशो निर्जिता: युधि |
ऐश्वर्याद भ्रन्शिता:
स्वर्गात सम्बभूवु: क्षिताविह || 1.64.28 ||
"And, O bull of the Bharata race, when such was the blessed state of
the terrestrial world, the Asuras, O lord of men, began to be born in
kingly lines. And the sons of Diti (Daityas) being repeatedly defeated
in war by the sons of Aditi (celestials) and deprived also of
sovereignty and heaven, began to be incarnated on the earth.
So in conclusion devas were not always weak in position but due to the boons and powers and devotion of Asuras they were unable to fight with them alone without help of the three Gods and win the battle , without taking permission or the help of Trimurties.