Basically by asking "How were Trimurthis born?" This question is asking "Who is the originator of whom?" Or "Who is the Ishwara?" Several answers are given here, but most of them are only from their perspective. Here I present all perspectives of all Trimurty.
Yajurveda Shatapatha Brahmana 126.96.36.199
- Verily, Prajâpati [Brahma] alone was here in the beginning. He desired, 'May I exist, may I reproduce myself!' He toiled, he practised austerity (or, became heated). From him, worn out and heated, the waters were created: from that heated Person the waters are born.
As it clearly says 'Brahma' alone was there. So, there is no question of being someone (Vishnu/ ShivaLinga) to produce him. He self existed as per his desire.
As he wished 'May I reproduce' he started creation. So, 2.6.1 of Taittariya Upanishad applies to Brahma:
2.6.1 He (the Self) wished, “Let me be many, let me be born. He undertook a deliberation. Having deliberated, he created all this that exists. That (Brahman), having created (that), entered into that very thing. And having entered there, It became the formed and the formless, the defined and the undefined.."
So, Brahma is himself the 'Brahman'. He is the self of all. So, everything we see and perceive is simply just him. So, Brahma is the Ishwara. He desires so he is also Intellectual cause of creation. He created water, foam, gods... etc. So, he is Material cause also. So, Krishna saying in Gita "No one knows my origin. I'm without beginning... etc.." simply applies to this eternal Self only. Thus Brahma alone created all. There was no one in beginning to create him. He self-existed.
Mahopanishad of Samaveda
I-1-4. Then we shall expound the Mahopanishad. They say Narayana was alone. There were not Brahma, Shiva, Waters, Fire and Soma, Heaven and Earth, Stars, Sun and Moon. He could not be happy. From the (desire of) the Paramatman, the Yajnastoma (hymn known as Avyakta) is said to have arisen.
As it clearly says Narayana alone was there. So he is the creator of all. Also in Taittariya Aranyaka of Yajurveda 10.13.
Narayana is the Supreme Reality designated as Brahman. Narayana is the highest (Self). Narayana is the supreme Light. Narayana is the infinite Self. [Narayana is the most excellent meditator and meditation.] Whatsoever there is in this world known through perception (because of their proximity) or known through report (because of their distance), all that is pervaded by Narayana within and without.
As it says "whatsoever in world is simply Narayana"... so the stories describing creation by Brahma and Shiva are simply the creation by Narayana as everything is Narayana. Vaishnav Puranas mention this thing as:
Narayan alone was there ---- He appeared as sleeping in water--Lotus bud came from his Navel ---- It was sum total of fruitive activity of living entity --- Vishnu entered as supersoul in that lotus bud --- He impregnated it with material modes of nature--- Then Brahma was born there---- During the creation process he became angry--- Rudra emerged from the forehead of angry Brahma--- and so on the creation continued...
Srimad Bhagvatam 3.8, Srimad Bhagvatam 3.12
So, from above Lord Vishnu himself is the creator of Trimurty.
Svetasvatara Upanishad of Krishna YajurVeda (which is considered among the principle 12 Upanishads) declares this:
Rudra is truly one; for the knowers of Brahman do not admit the existence of a second, He alone rules all the worlds by His powers. He dwells as the inner Self of every living being. After having created all the worlds, He, their Protector, takes them back into Himself at the end of time. [Svetasvatara Upanishad 3.2]
As there is no second. So, stories denoting creation by Vishnu and Brahma are simply Rudra itself.
He, the omniscient Rudra, the creator of the gods and the bestower of their powers, the support of the universe, He who, in the beginning, gave birth to Hiranyagarbha −may He endow us with clear intellect! [Svetasvatar Upanishad 3.4]
Here is what Taittariya Aranyaka of Yajurveda in 10.23,24 declares in passage of Rudra:
Supreme Brahman, the Absolute Reality, has become an androgynous Person in the form of Umamaheshvara, dark blue and reddish brown in hue, absolutely chaste and possessing uncommon eyes. Salutations to Him alone who is the Soul of the universe or whose form is the universe. All this verily is Rudra. To Rudra who is such we offer our salutation. We salute again and again that Being, Rudra, who alone is the light and the Soul of creatures. The material universe the created beings and whatever there is manifoldly and profusely created in the past and in the present in the form of the world, all that is indeed this Rudra. Salutations be to Rudra who is such.
As he himself gave birth to Hiranyagarbha. So, there is no question of birth of Rudra from Brahmas forehead. It wasn't Shiva, they were just incarnations of Shiva. Shiva isn't among the Rudras who came from head of Brahma. Mahabharat states it several time. Here is one instance only:
The Mahabharata, Book 12: Santi Parva: Mokshadharma Parva: Section CCLXXXIV
"Daksha said, 'We have many Rudras armed with lances and bearing matted locks on their heads. They are eleven in number. I know them all, but I do not know who this Maheswara is.'
So, now it is clear that Shiva already existed before manifesting as Rudra from forehead of Brahma. So, Shiva is the creator of all as he is the Supreme Brahman. Also he manifests himself from forehead of Brahma, multiplies himself to 11 in number and helps in creation by Brahma by entering in 8 different forms. The summary of Shaiva Puranas (Shiva and Linga Purans) is as:
Parabrahman denoted by Linga of Shiva Shakti--- From right side Brahma came---From left side Vishnu came---- later Brahma boast to Vishnu to see creation in Beeja form by entering in his stomach--- Vishnu enters and sees a Universe in Beeja form--- Vishnu come out--- Vishnu tell Brahma to enter in his stomach and see--- Brahma enters from mouth--- Brahma gets shocked on seeing multiverses in stomach of Vishnu--- he wanted to come out--- Vishnu blocked all 9 exits of his body--- Brahma remained blocked there--- Brahma then comes out from Navel of Vishnu--- thus as he came from Navel of Vishnu he became son of Vishnu-- then debate started between Brahma and Vishnu-- latter in the creation process Rudra came from forehead of Brahma--- then sustained the creation. [Linga Purana 2.2]
Vyasa in Mahabharat states this process (ie. Vishnu coming from Linga as):
Kesava is that devoted worshipper of Rudra who has sprung from Rudra himself. Kesava always worship the Lord Shiva, regarding his Phallic emblem to be the origin of the universe. The Lord Kesava always worshippeth Siva in the Phallic emblem as the origin of all. [Drona Vadh Parva chapter 201]
Note that above portion of Mahabharata is Jaya section the original 8800 verses of Mahabharata ie. Direct narration by Sanjaya
So, from above Lord Shiva is creator of Trimurty.
Thus from one perspective we see one truth and from another persepective we see another truth.
Mahabharat says this:
The Supreme Spirit hath three condition. In the form of Brahma, he is the Creator, and in the form of Vishnu he is the Preserver, and in his form as Rudra, he is the Destroyer of the Universe. [Mahabharata Vana Parva Section CCLXX]
Harivamsa Parva of Mahabharat (2.125 section) says this:
Remember that Rudra (Shiva) has the soul of fire and ViShNu has the soul of soma (nectar, moon). All the world including the fixed and movable beings have the combined souls of fire and soma (Shiva and ViShNu). The supreme lord of Rudra (Shiva) is ViShNu and the supreme lord of ViShNu is Shiva (Rudra). The same lord is moving in the world always in two forms. ViShNu does not exist without ShaNkara (Shiva) and Shiva does not exist without Keshava (ViShNu). Hence, Rudra (Shiva) and Upendra (ViShNu) have attained oneness, since long before.
So, the truth is what is above mentioned. One doesn't need to boast that what he tells and thinks is the only truth by citing verses from his own perspective.