The driver who died following a train crash in Bedford had passed a red signal moments before the collision, accident investigators have said.