Please read the entire answer. In English (at least in the USA, but I think elsewhere), for transportation that uses fixed routes, like trains, we normally use the.
I took the train to work.
There is no "specific train" being referenced, but the railway that is fixed, upon which or by which trains run on, on a fixed route.
If we refer to transportation that does not usually run on a fixed route, we generally use a
I take a taxi to work.
Taxis are usually not limited to fixed routes.
How about the bus?
Buses (or busses if you prefer) usually run on a fixed route; thus we would expect
I took the bus to work.
(Compare: I took the bus to Miami.)
Again, this refers to the fixed route, along which travel several buses a day.
However, as stated elsewhere, the author can choose to say 'a train' or 'the bus'. English gives you plenty of options. In fact, it could mean the traveler (or traveller) takes a bus on one of several fixed routes, but this seems to me to be trying to forcefit the language (even if into the general usage stated here).
Obviously, one could say
I took the taxi to work.
But this is a different usage. Now the speaker assumes his interlocutor knows which taxi he took (maybe he has mentioned it before).
1An example of the same construction in a perhaps less confusing context: "I'll have the fish and a small salad" when ordering at a restaurant. This might result in several small fish, or even in several different kinds of fish; but there will only be one salad. – Simon L Rydin Myerson – 2020-07-13T09:22:53.383