The locomotive spewed out bright sparks angrily