I am going from a plain HTML site to a dynamic php based setup and my site does very well in terms of search engine rankings, is on the first page for some keywords. My question is which CMS would serve me better in terms of SEO, Joomla, Drupal or any other?
Drupal for sure. I did basically the same thing you're about to do a few months ago (with Drupal) and I LOOOOOVE it. Joomla can't beat Drupal's scalability and ability to create dynamic, customizable sites. Drupal > Joomla in terms of SEO,
Depending on the size of your site you might want to check out Wordpress as a CMS. It's very easy to SEO it.
I would have to vote for Drupal with Clean URLs enabled and both the Path module and the PathAuto module - all three very important for SEO.
It'll be a medium-ish affair, and has a possibility of swaying either ways. Any demos of a site using wordpress as a CMS (other than blogs).
I *think* that if there is any possibility of doing anything more than just "pages", you'd be better off with Drupal than Wordpress in the long run. Drupal has far more options and modules than WP..