triads of gods have absolutely existed in many if not most cultures since ancient times.
The concept was explicitly introduced to Christianity a few hundred years after Christ, alongside quite a few other practices adopted from pagan traditions, perhaps to try make the Christian doctrine more approachable to the masses.
Links to 'triads of gods' are spurious at best. As I said, there was no system which espoused the idea of one God in essence but three persons, and most evidence we have for these pagan religions is only to be found post C1 anyway. The trinity wasn't based off pagan mystery religions, much as the other central tenets of Christianity weren't. For one thing, those systems would have been utter anathema to the first Jewish converts, who were sickened at the pagan practices of child sacrifice, ritual rape etc so would have gone nowhere near them for forming their own doctrine.
Instead, while the formalised doctrine of the trinity was only made official in C4, the actual teaching of God as three persons was implicit (and explicit) right from the start, in the gospels then through the NT and extra-biblical documents. In 2 Corinthian 13 for eg Paul signs off in this manner: "The grace of the Lord Jesus Christ, and the love of God, and the fellowship of the Holy Spirit, be with you all." Paul continues this trinitarian message throughout his writings, making it very clear that the three were worshipped and were different persons yet a united Godhead.
In the Didache, the very early first 'catechism' or teaching of the church, believers are instructed to baptise in the name of the father, the son and the holy spirit. These are not venerated as creatures but as divine, in one essence.
Loads more early Christian writers made it plain they worshipped God as three in one: eg Polycarp, an early Christian martyr: said, 'I glorify You, along with the everlasting and heavenly Jesus Christ, Your beloved Son, with whom, to You and the Holy Ghost, be glory both now and to all coming ages.' the persons of the trinity were all worshipped as God.
It certainly wasn't a doctrine forced on the church suddenly centuries after Jesus. It was a well used and understood part of the earliest doctrine, recited in the earliest creeds, then eventually formalised as an official doctrine when dodgy teaching tried to sway believers from it. The evidence is powerfully for it being a progressive understanding, embraced from the start, rather than a sudden decision. Much like the canon of scripture, church leaders made decisions based on the wideness of use and the antiquity of doctrine, ensuring consistency with scripture and early writings.