Many factors influence the cost of both train tickets and airfare, but trips of a few hundred miles generally are cheaper by train.