He has become an Internet hero.
After the reptile was spotted hiding on a baggage rack, the train made an emergency stop.
The train was headed to Jakarta from Bogor, south of the capital.
A smartphone footage showed the man casually snatch the snake's tail. He then smashed reptile's head on the floor in a powerful whipping motion.
The action shocked spectators.
Video courtesy: jktinfo/Instagram