But it was established at the end of BTTF II that the time circuits were damaged in the DeLorean and he had no way to travel through time until 1955 Doc was able to fix it.
So even if we assume that he made one trip to the distant future to retrofit his train with all of the bells and whistles of a great, slick looking time machine, he still couldn’t make the first trip.
Doc built the first flux capacitor in his garage, so it presumably doesn’t require any particularly exotic parts, other than the uranium fuel. Obviously, the selection of off-the-shelf electronics available in 19th century California was lacking - except that when Marty went back to the movie title, he left his futuristic hoverboard behind. It’s movie-plausible that Doc could have used the components from the hoverboard to re-invent the flux capacitor and install it on another train, and then get all the hover stuff added in when he visits some future era.
That said, the flying, time-travelling train was very cartoony in a way that the rest of the series was not, and felt out-of-place.
Also the fact that Doc repeatedly told Marty to destroy the time machine when he got back to the future, because he was afraid of messing up the timeline again. So then why would he build another one? (Unless his nagging wife and kids forced him into it. )
The problem with AI, IMHO, is that it was originally supposed to be a Stanley Kubrick film, and while the two filmmakers, Kubrick and Spielberg, shared a love of science fiction, they had very different sensibilities: Kubrick was obsessed with dehumanization, whereas Spielberg is one of Hollywood’s great humanists. Their points of view were essentially irreconcilable, and led to a movie that simply didn’t work on the conceptual level.
My guess is either he, his wife, or his one of his kids got sick and the only way they could be cured was to go to the future–prompting him to break his vow never to build another time machine.
I have to admit that I never assumed for a moment that they were aliens. From what I recall of the dialogue (and the way the data was transferred) they appeared to be highly-(self-)evolved robots in the distant future. The ending contextualizes the rest of the film, humanity’s love/hate relationship with AI making more sense in the context of an actual threat of “replacement” as people essentially make themselves extinct as a species. The new robots are working to remember and learn about their original creators, which makes the records of the direct experience the preserved kid robot had with humans so valuable to them. In a way, he “saves” humanity, if only in memory.