The use of trains to carry crude is surging as drillers in parts of North America produce more oil than pipelines can accommodate.