Do both parties get the same technology out of a research agreement?

Correct, they are not necessarily the same. You will receive a random technology from those that are available to you, and they will receive a random one for them. This does imply that if you are making use of research agreements, you should try not to "skip" techs that are cheap, since you want the research agreement to give you something as "expensive" as possible.