City agrees to safety upgrades at Phoenix railroad crossing