There has already been a question about why Doc built the time train. My question is how he did it.
Doc clearly could not fix the DeLorean to return back to the future. Thus, he hid the car in the Delgado mine leaving Marty a letter which indicated that the necessary components would not have been invented until 1947.
And yet he somehow managed to build a time machine inside a train after he left with Clara in 1885. We know that the time train was already working when both his sons were not older than 10 years old. This means that he had build the time train presumably not later than 1895. Even at that time there were no electronic components available. How did he create the flux capacitor then?