CSX freight railroad on the US East Coast has ratified a new contract with the Teamsters union for 4,000 employees.