Norfolk Southern Corp. said Wednesday it nearly doubled its profit in the second quarter, boosted by record railway operating revenue and the effects of tax legislation.