Well, there are many brands of H.264 codec (Sony, Apple, Main Concept, etc.) and no two programs compose event the same brand of codec file exactly the same way. So no program is going to give you the exact same size file out as you put in.
Composition can also affect file size. Video with little action or changing scene can create a much smaller file than video with a lot of action.
M2Ts are generally of the highest quality, since they're generally used for editing and creating BluRay discs. While MP4s are generally used for online display or playback on portable devices.
I know that's not a satisfying answer -- but if you can find someone who can show mathematically why every program creates the size of files they create and how to predict what size file a program will create, I'd love to meet him. Though even after a decade of working with digital video, I'd probably still have no idea what he was talking about.
It's just so weird how the file size is the same regardless of the bitrate - but only when exporting as m2t. And how can Elements tell me the bitrate is 2.7 MB (so massively different from 17 MB) when every other bit of software tells me otherwise!! I feel like it's my lack of technical knowledge that's the problem, but I'm not convinced it is...