Exchange rates, inflation rates, and interest rates all modulate each other such that the arbitrage opportunities you suggest disappear.
For example if country A has inflation of 2% and country B has inflation of 4% then the exchange rate of country A should appreciate by 2% to equalize the two time periods.
Of course in the real world you can't split observed interest rates into the real rate and the inflation rate. But, you can bet that if a significant arbitrage opportunity did exist then some trader would be exploiting it and by doing so pushing everything back into balance.