Boonseub Samakraratch, chief of the Forest Protection and Forest Fire Prevention Office, led the raid in a protected forest in Thong Pha Phum district.
The officials found a cave in the area and went 30 metres inside where they found four men digging. They were ordered to immediately stop work and surrender.
Arrested were Na Toomsri, Charin Sukkhamhaeng, Ekkachai Krathaithong and Chatuchok Teenarit.
Mr Na said he and the other three workers had been digging the cave for one month after being hired by a man they knew as Mr Ad. They were searching for treasure believed to have been left in the area by Japanese soldiers when they built the Death Railway during the war.
Authorities charged the men with illegally intruding and occupying the forest in violation of the Forestry Act. They also seized their equipment, including a electricity generator and ventilation ducts.
The occupying Japanese built the Death Railway through Kanchanaburi in 1942 to supply their forces in Burma. They used forced labour of thousands of civilians and soldiers to construct the route which closed in 1947.
Some Thais believed that Japanese soldiers hid their treasure, including gold, along the route before they returned to Japan.
The area was put back in the national spotlight in 2002 when Thaksin Shinawatra visited the area after then-senator Chaovarin Lattasaksiti claimed that he had found 2,500 tonnes of precious items at Lijia Cave in Sangkhla Buri district and successfully convinced Thaksin, then the prime minister, to see them with his own eyes.
That turned out to be a hoax.