It seems that when converting hammers to research ("building research") it only uses the base hammer count. Production advantages like a forge are also lost when you convert hammers to research, so I assume that extra hammers like those from chopping wood are also discarded.
Mind you, this is an explanation of what happens. I agree it would be a lot nicer if those hammers were also used for research (at 50% discount) or otherwise at least saved until when you start building something tangible.