If you are still syncing your Mail account in iTunes, this setting will revert each time you sync. So, if you manually change the location of your Sent mail on your iPhone, it all works -- until the next time you sync. Then your iPhone starts filing the mail in its internal memory. What's worse, if you change the setting back (to leaving Sent mail on the IMAP server), the local iPhone Sent mail folder is no longer accessible -- it just disappears. Never fear, though, it didn't go away, it's just not being shown.
The fix is a simple one. In your iPhone Settings » Mail » your account » Advanced, change the Mailbox Behaviors for each of the problematic mailboxes so that you are filing mail on your iPhone (not on the IMAP server). Now in the iPhone Mail app, you can get to the 'lost' folders. The corresponding IMAP versions of these folders should also be available to your iPhone mail. You can now move your email messages into the correct location (one-at-a-time, ugh). Once you are done, change your folder settings back on your iPhone.
As an aside, I have found the iPhone Settings app to be a bit buggy, so this may be voodoo, but it's worked for me: before changing any folder settings, exit all Mail folders in the iPhone Mail app first (so you are at the topmost view). In iTunes, make sure you disable syncing for that mail account. This will leave the settings on your iPhone intact.

