Officials said the man did not appear to be targeting Trump or others involved in the trial
The accident took place on Sunday afternoon in Yilan County near the coast, with several carriages overturned on a railway popular among tourists.
"As of 6:30pm there are 17 dead on site and 126 people injured," the Taiwan Railways Administration said in a statement, adding that the train had been moving between two stations in Yilan County before the derailment occurred.
Taiwan's central government said that rescue services were at the scene and that the premier had been notified and was highly concerned over the safety of the travellers.
Taiwan's Central News Agency reported that more than 30 people were still trapped in the train early on Sunday evening.