I was actually having this issue before my upgrade to OSX Mavericks, What I've found was that is has something to do about where sent messages actually lands on the imap, Apple mail (wether it be on iOS or OSX) somehow doesn't translate it so that it can threads these replies correctly 😟 And I still yet doesnt have a solution for it, but it's a pretty sad behaviour, which solution in fact should have been default in both apps.
..in that way i mean, when replying from OSX Mail it wont show up as replied on iOS, and the other way around, because although the respective app internaly knows what happened, it doesn't sync over to Google's IMAP so that the other app can translate it.