I played a bit more in my test game and another one I just started, and I am starting to believe that the main problem with the AI trading stems from the fact that techs are discounted so that they are ridiculously cheap for the last civs to know it (I am again only talking about the Ancient era, since it becomes very hard to track trades and map switches between AI players later in the game).
On a few occasions I saw the AI player trade a worthless map (i.e. one that they had switched the turn before and contained virtually no new information) for a tech (a cheap one, but still). However, more often did I see AI players with 0 gold and behind in the tech race and suddenly again at par with the other AI players.
I think there are several reasons why this happens. In the very beginning the AI can easily catch up with the others by trading maps and communications. They will do this very aggressively, and even on Archipelago maps will the AI have communications to all players very soon. This gives them lots of opportunities to trade and tech-whore.
The AI puts 100% science as long as it hasn´t any upkeep costs, and because all AI expand roughly the same speed, they will all discover techs at roughly the same pace. Also, they all seem to pursue roughly the same tech tree. So, when one civs discovers a new tech, it trades it to those who can pay for it. Usually, it does not trade the new tech with civs with 0 gold in the treasury. However, since most civs now know the tech, the 0-gold civs will very fast discover the tech by themselves. This can look as the broke AI got the tech for free ("as a gift") when it in fact discovered it. The decreased number of beakers is usually not visible to the human, since he is often reasearching other techs or has minimal science to give the tech in 40 turns.
Consider this example. An AI player with 100% science has put 60 beakers into a tech that cost 100 beakers. It makes 5 beakers per turn, meaning discovery in 20 turns. The human player researches the same tech but puts his money into taxes (4 gold, 1 science). For the human, the discovery will take 40 turns, and by this time he has accumulated 12 beakers. Now, one AI discovers the tech and trades it to 3 other. With 8 players, the cost drops to 50% of the original (4/8). The AI player now has 60 beakers, but only 50 are needed, so he also discovers it the same turn. The human player still only has 12 beakers out of 50 and does not notice any change in the number of turns to discovery. Also notice that this difference is even more noticable on the higher levels when the AI only pays a fraction of the cost for a tech compared to the human.
When techs become more expensive later in the game, the effect will not be as visible, and the human can often get the chance to take the lead.
On the easier levels, this fact can be used to your advantage. Start as expansionist, race for all goody huts and make every effort to take a small tech lead in the very beginning. Make contact with all AI civs as soon as possible. Now, talk to all AI civs every turn and ask what they´d pay for your techs, one by one. Track the difference in offers from turn to turn. If the offer steadily decreases, you know that the AI is researching the tech. Sell it to him just before he discovers it (when the AI only offers a few gold). Trade it to everybody that has anything valuable, starting with the AI that has the most money. All AIs have now been putting 100% science into a tech they then instead bought, and they have to start from scratch with a new tech. With the money you can also have a high science and buy a few libraries and keep your capital big (not cranck out settlers all the time). This keeps your tech lead.
Of course, the AI will every once in a while discover a tech you don´t have. Don´t panic. Unless you really need it, wait until all AI civs have the tech. You can buy it very cheap after that (this also works on the higher levels, of course).