Yes train is the better choice. But taking it both ways is a lot of extra travel time. Sounds like your flights are already booked? If not, I'd look at seeing if you can book DC-London and then Edinburgh-DC as a single ticket. That way you save a good amount of time backtracking. If already booked, maybe see if you can change the return to leave from Edinburgh? Might be possible, depends on ticket type.
Use the National Rail site to search best options, then book directly with whatever railway has the best price.
https://www.nationalrail.co.uk
Best options almost surely going to be LNER or Lumo, those are the main options to Edinburgh