They did not have fiat currencies in our prophet's time. In fact, fiat currencies are a recent invention of the last 150 years. Fiat currencies used to be backed by gold. For example, prior to 1971, the US Dollar was backed by gold. Then president Richard Nixon took the dollar off of the gold standard after he made agreements with Saudi Arabia, Iran, and Persian gulf countries to sell their petroleum only in US Dollars. So, in effect the dollar has been backed by petroleum reserves instead of gold since that time.
Despite being backed by international petroleum reserves, the dollar continuously loses value compared to real assets like gold, silver, land, fuel, food, etc. This is known as inflation and is a form of riba. Inflation is particularly acute for fiat currencies that are not pegged to the dollar or euro and not backed by any real assets; such as the currencies of many third world countries.
Therefore, when trying to determine the real amount of riba involved in a loan or mortgage we have to compensate for inflation of the currency compared to the value of hard assets like gold or silver. If the inflation of the currency compounded on a monthly basis underlying a 30 year mortgage equals the the compounding interest rate of the note, then there is no real riba since the effect on one cancels the other.
In conclusion, while interest charged on a note based on hard currency is definitely riba, this is not always the case for loans based on fiat currency.