Yes, it is never about who is more powerful as these are the three names of divine cosmic energy or the Ultimate consciousness.
Human mind tries to compare, but the absolute truth is oneness (Advaita), and these are three forms of One Divine Reality known as Para Brahman which is eternally auspicious and is without beginning or end in its own bliss. It can also be understood as the pervasive energy which is everywhere and it is beyond time, space and imagination.
It is like the infinite sky. In fact, the oneness of Brahma, Vishnu and Shiva can be best understood with the Om or Omkara (the Pranava) which is actually Aum.
A (Akaar)– Associated with Brahma, it is the seed, i.e., creation which is expressed out.
U (Ukaar)– Associated with Vishnu, it is the cosmic energy that carries/holds or preservers or sustains the creation.
M (Makaar)– Associated with Mahesh, it is the cosmic force that causes the dissolution of the creation back into the absolute oneness, so that recreation can happen, the seed can again be generated.
So the essence remains the non-duality of these three as one complete reality as they are inseparable fundamentally.
Cosmic play of Tridev (Brahmā Viṣṇu Śiva)
The story you are asking about is the story of Lingodbhava. Although the story Shiva centric but it's message is non-dual nature of Brahman. So it can very much be viewed with the non-sectarian lens.
According to the story, once Brahma visited Vishnu who was in his yoga nidra, the divine sleep. Since he was in a deep slumber, he didn't welcome Brahma.
Brahma then gets offended and wakes him up. Vishnu then asks him the reason behind anger to which Brahma claims that he is greater than Vishnu. In response, Vishnu denies it.
This leads to an argument between them. So in order to settle the conflict, Shiva appears there and takes up the form of the eternal pillar or the column or fire.
The fire pillar form of Shiva was very large and it led to their curosity to explore it. Shiva then asks Brahma and Vishnu to search the origin or end point of the pillar.
So Vishnu takes the form of Varaha (wild boar) and goes deep down to search the end point. While Brahma takes the form of a swan and goes upwards to find the origin of the pillar.
But after a long time, Vishnu comes out and accepts that the pillar was indeed without an end. Brahma on the other hand had a plan in his mind as he wanted to win the contest in any case, so he uses his divine powers to make the Ketaki flowers speak in favour of him. He then came out, declared the flowers as the witness and claimed that he has successfully found out the origin of the eternal, infinite pillar.
Since Shiva was aware about the lie, he disqualified Brahma and said that he won't be worshipped because he was deceitful while taking part in the competition. On the other hand, Shiva declared Vishnu as the winner and declared that he would be worshipped with great honour.
But Brahma’s fifth head out of arrogance said that he is better than Shiva and Vishnu.
So in order to remove that ignorance, Mahadeva manifested his divine anger because of which Bhairava emerged from his third eye 👁️.
Kaal Bhairava then cuts the fifth head of Brahma which represented ego. Vishnu then requests Shiva to forgive Brahma, then Brahma apologizes to Shiva.
Shiva forgives Brahma and blesses him by calling him as his dear. Shiva did the same with Ketaki flowers, he cursed the flower by stating that his worship will not include Ketaki flower but when the flower accepted its fault and apologized for the mistake, Shiva blessed it by saying that the flower would be definitely used for decoration.
Thus Bhagwan Shankar didn't punish Brahma, he enlightened him to be overcome his ego and understand the non-dual reality by becoming humble.
However, the human mind tries to create the difference by evaluating Shiva or Vishnu as the Supreme and Brahma as inferior or anyone as the Supreme and other two as inferior or if the story doesn't suit the reader, he/she might call it fake or something like that.
The message here itself is oneness but in a true sense. Doing comparison and claiming one as superior to others or downgrading others is wrong, the ultimate reality remains oneness. When Shiva in the form of Bhairava chopped Brahma’s head of ego, he did not attack a different entity from himself. Basically he did a lila, a cosmic play to teach the importance of truthfulness and humbleness.
Brahma in this case has to be considered as Shiva’s very own form in which he acted in a particular manner and so Shiva cuts off his head in order to show the side effects of growing arrogance within an individual.
Similarly, Shiva and Vishnu also are to be considered as one. Vishnu acknowledged the never ending ultimate truth, Shiva thus praised him for being truthful and showed that one can surely get the benefit for being righteous.
So the absolute truth (oneness) is about revering all as one Ultimate Reality rather than wasting time and energy in comparisons. Thus the bond of Brahma, Vishnu and Shiva remains unbreakable as the three forms of One Ultimate Brahman.