Amtrak has multiple routes which stop in both New York City and Washington DC. The Acela Express, Northeast Regional, Carolinian, and Vermonter lines all visit the two cities. New York City's Penn station and Washington DC's Union station are serviced. On most lines, the trip takes around 3.5 - 4 hours.
Both train stations leave you with easy access to local subway transportation. Penn station is within easy walking distance of the 1, 2, 3, A, C, E, N, Q, R, B, D, F, and M lines in NYC. Union station in DC has its own red line stop, with transfer points in the direction of Shady Grove station at Gallery Place (Green and Yellow lines) and Metro Center (Orange and Blue lines). Our metro page has more information about DC's metro system.
Amtrak's high speed train, the Acela, can shave off some time (though generally the difference is less than a half hour), and provides additional amenities, such as wireless internet. However, Acela's higher price and minimal improvement on travel time makes the benefits marginal at best.
Prices start at around $50, but increase a couple of weeks before travel time, so book ahead for the best deal.