I once considered doing this for a 6am flight out of DCA, but when I looked into it I realized that the DC metro doesn't start running quite early enough to make it work. When you say that Megabus has an "overnight" trip I hope you're not making the same mistake!
Coming from New York, the lack of 24 hour service on the DC Metro is definitely frustrating, and it's kind of ridiculous that our nation's capital can't run trains at that hour. I'd wonder if there might be buses that run from the District to the Airport at that hour, but I didn't find any bus schedule that seemed to run then either.