Unread mail count on iPhone / iPad is often out of date Apparently, data is only pushed to the iPhone when a new unread emails arrives. 
If you read an email on your desktop or on the web, the 'Read' status is not being pushed down to the iPhone until another new email is being pushed down or you check manually.

It's very annoying because I always think there are new messages when there aren't, and the only way to find out is to launch Mail.

Is there a solution?
Unfortunately No

As far as Apple is concerned this is by design, and even the latest mail upgrade on MobileMe did not enable this functionality. This has been discussed at length on the Apple forums and hopefully at some point this change will be made.

There is no known workaround, as this is controlled by the server, and not the local app. Even jailbroken their is no solution I am aware of.