EDIT2: Checked again - I was wrong the one with the insane numbers is actually a custom faction. The one I had beaten before which also seemed to have very high tech (city militia with boreal blade?) was vanilla (oracle ceresa).
I don't think it was a queue issue.
One of them was a kingdom player that I was neutral with. When I opened the diplomacy screen they had insane numbers in the tech trading section (some 15000+ in total, compared to ~700 on my side) and when I entered their territory with my hero and opened the shop, I could buy high end stuff that would have taken me a few hundred turns to research (and my research rate had been higher throughout the game and at that point was about 5x theirs, according to the graph when I retired the game). So I don't know where they should have that amount of research points from.
It was on easy difficulty, so it should definetely not be caused by AI bonuses or anything like that. I personally don't see any legit way how the AI could have gotten to those research levels, so I think there is a bug somewhere.
As I said my best guess is the technology trading, as that could also explain why we don't always see it - just when two factions "like" each other enough and are both keen on technology trading (no idea if there is any preferences like that) - so they do it repeatedly over a longer period.
I haven't yet figured out exactly how tech trading works, but it seems to me that I can only trade the amount of those techs that the other party hasn't researched yet (or something like that).
However if this restriction is not properly applied to the AI, they could just trade all their research points. And they might be able to do this over and over again (with ever higher numbers since the points from previous trades could also be added in). You'd get some exponential growth that could lead to numbers like that.
But again that's just a guess.
EDIT: If there is no such restriction as above, there definetely needs to be one. Otherwise factions could just as well stop researching and keep trading tech points to advance the tech tree.
EDIT3: Some details of the game
Season is 319
On the tech trading screen I see tech values:
Their shop sells
Boreal Blades (takes me 200+ turns to research the necessary tech)
Champions Cuirass (another 130+ on top of that)
My current rate of research 59.8 with 12 cities.
Theirs is (estimate from the research graph in retire screen) below 10 and most of the game has been more like below 5 with 2 cities (don't think they ever had more).
EDIT5: Another thing that came to my mind and might be a factor - I was playing with many (9) AI factions, so there could have been more than average tech trading going on. However even if I add up all the research of all AI factions that would not be enough to get those tech levels (9 x 5 (on average, actually rather less than that) x 319 = 14355).