I've taken the train repeatedly both when my DC1 was around that age and when DC2 was around that age - it worked very well, even when I had two kids to cart around, one a preschooler and one a toddler. Train worked better for me because they could walk around a bit if they wanted, instead of spending hours just in the car seat. Plus, driving a busy route like DC-NYC with a toddler who can do his best to distract you is no fun.
This said - train is only doable if (a) you have very little luggage. Transporting a ton of stuff PLUS a toddler is not something I'd wish on my worst enemy. (b) Your toddler is not a loud incessant screamer. Some are, in which case spare the eardrums of your fellow passengers
If you do decide to do the train, they offer pre boarding for those with small children - take advantage of it - that way you can pick a seat in the front with room for a stroller.