By two-way sync, I'll assume you mean that deleting a message on one device deletes it on all others, and icloud.com?
If I delete a message/mark unread/mark read/flag a message on an iOS device the message is updated nearly instantly on icloud.com and my Macs. If I do the same on a Mac using Mail, the change happens on icloud.com, but the iOS device is not updated until a fresh push connection happens. Then the sync occurs. I don't think the issue is technical though, but is a means to reduce battery consumption by not pushing every flag status or read/unread status to every iOS device, where battery life means something more than on a Mac (especially a desktop). Gmail is seamless - but on iOS keeps a persistent connection to Gmail, thus why it updates so fast. I haven't measured battery consumption personally.