State media report that a stationary commuter train was hit from behind by a long-distance commuter train arriving on the same track. BBC reported.
The final number of casualties is still to be confirmed and rescue efforts are under way to free a number of passengers trapped, officials said.
Footage shown on local media shows passengers on medical trolleys near Bekasi Timur Station, with other images showing rescuers trying to free people from the train wreckage.
Confirming the four deaths, a spokesperson for state-owned railway operator KAI, Anne Purba, said 38 other people had been taken to nearby hospitals.
KAI expresses its deepest condolences and condolences to the victims and their bereaved families," Purba added.
The death toll could rise, according to the Deputy Speaker of the Indonesian House of Representatives, Sufmi Dasco Ahmad, who visited the site - which is approximately 25km (15.5 miles) from Jakarta.