"There was a driver in his forties and a passenger in the car. They likely died instantly. All that's left of the car is a pile of scrap," Västmanland County police spokesperson Per Strömbäck told the TT news agency.
The accident happened on Wednesday morning between Sala and Heby.
Speaking with the Expressen newspaper, police spokesperson Börje Strömberg explained that the taxi had driven up on the tracks when the level crossing barriers came down.
"Our theory is that the sun was quite low then and that the driver became blinded and didn't see that the barriers had gone down," he told the newspaper.
None of the passengers on the train were reported injured in the accident.
"However, the passengers are naturally in shock," said emergency services spokesperson Daniel Wåhrenberg.
The train, which according to national rail operator SJ was a commuter train on its way from Uppsala to Norrköping, is resting on the tracks while SJ works to arrange alternate transportation.
"It's a smaller train and since it was during the day there weren't that many passengers," SJ spokesperson Malin Nygren told TT.
For the passengers having trouble dealing with the accident, SJ is offering on-site crisis assistance.