Level crossings to be upgraded after $300 million funding boost