The accident occurred on a stretch of track near Kilafors south of Bollnäs. Police were notified by the Swedish Transport Administration (Trafikverket) at 10.07pm.
“We we got there we found two men who were deceased,” said duty officer Peter Hultqvist of the Gävleborg County police to the TT news agency.
Police say both the men are over 30 years old, but have not yet been identified, the local HelaHälsingland.se news website reports.
According to the Transport Administration, the accident resulted in a stoppage in service along the line until 1am, causing delays for a number of trains, including the night train to Luleå in northern Sweden.
The circumstances surrounding the accident remain unclear and police have yet to determine how the men managed to make their way onto the tracks.