I used to play The Dark Eye (Das Schwarze Auge) myself and in my opinion it strongly resembles medieval Europe - apart from the obvious fantasy additions. It's rule books give information of the economy, trade and demography of nearly everything.
Therefore the dilemma is quite understandable; in medieval Europe a sword was worth a fortune and in the world of The Dark Eye it is the same. However, a hero needs a sword right?
Well, maybe not necessarily. In our group we don't have a rule to handle wealth but here are some thoughts on how we somehow deal with it usually (after writing it down I realised that our heroes are not that wealthy because of these guidelines so it may not suit your question that well):
Equipment has flaws. Nearly everything a (starting) character possesses is not a shiny new blade but rather a crude axe, and old dagger from the grandpa, a warm winter coat with some holes, the elven bow that was handed to the character in a ceremony and would not be considered for sale.
Producing goods has its cost. It is true that potions or magical items are worth a hell lot of money in The Dark Eye. But producing these is an investment and requires material and knowledge - both of which can be costly to find.
Valuable findings are rare. Again, nearly everything a character finds, loots or gets possession of has either flaws or is an unknown object that requires identification.
However, here you'll find yourself in a situation where player and character knowledge interferes. An adventurer may not have ever seen a telescope and finds no use in keeping it but the player knows it is worth a ton of money. We also have some problems with stealing because the players have knowledge about the worth of goods - also stealing creates a difficult situation by either letting it pass or punishing the character that may hinder adventure progress (but that's a different story).
Carrying gold or whatever currency is not very common. Carry a chest full of gold and silver and it will attract thieves. Taxes may be imposed upon crossing borders and cities. And the greedy tavern keeper will charge more if he spots the characters entering in bling bling.
Value comfortable but rule-speaking unnecessary goods. Create an environment where player not only value the next best weapon or armor because it will raise their damage and defence in battle. Good shoes can be expensive but keep from getting exhausted and have a minor impact on game balance. The same with regular feel-good massages, company during the night, the feast at the end of an adventure. The more characters act with each other and the more a personality they have the more readily the spend money on that. All these are sorts of money sinks.
But in the end the characters are heroes and it may be frustrating to not get a bit wealthy at some point. The reward for risking their life is loot, treasure and occasionally - a very special event - the acquisition of a new and shiny sword.
Eberron has maglev trains
Eberron, which was originally written for 3.5, has the so-called Lightning Rail, which is basically a magical maglev train. It’s a fairly major part of the setting, and certainly doesn’t ruin anything.
Forgotten Realms and Greyhawk don’t have trains, or, apparently, mages who think
As you say, considering the incredible magical power available in these settings, it stands to reason that something like Eberron’s Lightning Rail could have been built, but both of these settings, basically, hinge on the fact that their mages don’t really think about the practical applications of their power much at all. Each has numerous epic-level wizards who apparently do nothing but sit in towers, “studying” but with nothing much to show for it.
If you take the power available to spellcasters in 3.5, and you take the levels available in Greyhawk or the Forgotten Realms, and take those to their logical extremes, what you get is the Tippyverse. That has trains, and an awful lot of other things. I’m not sure that the Tippyverse makes an interesting setting for a game, though the thought experiment is at least somewhat interesting just to think about.
But 3.5 doesn’t really have a default setting.
If you aren’t specifically using these settings, anything could go. On some level Greyhawk is sort of the default setting, but the overwhelming majority of the books don’t actually reference it in any way. None of the Core books includes a world map, descriptions of countries or their peoples, and so on.
As such, you could have a train, or not, without really affecting anything, because there is nothing to affect.
And, as mentioned in the comments, 3.5 doesn’t have an economy
The economics of 3.5 are basically a mess. You might see Tippy’s thoughts on them to see what I mean. Even if you don’t go to those extremes (and eliminate the powers that lead to them, either through houserule, gentlemen’s agreement, or plain fiat), there are broken issues all over the place. Most famously, two 10-ft. poles cost dramatically more than a single 10-ft. ladder, which means by simply chopping a ladder in half you can earn a very high return-on-investment. By the rules, in a big enough city you should find no shortage of either ladders or those interested in buying poles.
So if you want your setting to have a coherent economy, have fun: that’s something you’re going to have to work out yourself. Most 3.5 players simply just... don’t look too hard at the economy, and have gentlemen’s agreements to avoid exploiting this lack of real economic background.
Best Answer
D&D is not an economic simulator
5th edition least of all, given its deliberate choice to avoid valuing consistency or coherence in mechanics. Labor prices have always been a problem in D&D, whether the exorbitant prices charged by sages and the like in the earliest editions or the never-high-enough price for a sellsword. The fundamental problem is that the game wants (and has always wanted) a gp to be a large amount of money, enough to impress common folk and to make adventurers stand out and be notable in the fiction of the game world, and usually enough to justify a 'fantastic wealth-- if you survive' description of adventuring, but it also wants and has always wanted to charge players an arm and a leg for things, usually to ensure they must keep adventuring and taking risks and such. Unfortunately, this doesn't work. There are lots of epicyclic explanations that people have used at various points over the years to various effect, but ultimately it just doesn't work. The prices are too high and the given incomes are too low and the relationships between all the things make a mess out of any potential explanation if explored too deeply.
The solution is to ignore it. A laborer who gets paid on screen should receive roughly 1 sp for each day of work they're being paid for, and they enjoy a modest lifestyle consisting of roughly 1 gp a day in expenses if the PCs stay at their house a while. The PCs don't ask how much the laborer makes or how much he spends to supplement his crops, and everything goes smoothly.