This is quite a myth. Maybe these prices are low compared to US salaries, but in India or Romania or other big outsourcing places, salaries in the 4-5k EUR/month (48-60k EUR/year) are the norm, and it's easy to get even higher bills from cloud services if you're not very careful, even from testing and dev activities.
Actually, I haven't seen any clear sign of age-based discrimination here in Romania. There are two other factors that can give that impression, though.
For one, the programming demographics are extremely skewed towards younger people. There was almost no programming being taught or practiced in 1980s or 1990s Romania (and the same is true for all of the former Eastern bloc basically), and then there was a huge burst in the 2000s as the country decided to push this particular segment (even today, you don't pay the 16% income tax on your salary as a programmer with a relevant college degree). Overall this means that there are far, far more 30-ish programmers working in Romania today than 50-ish ones. I believe the same is true to one extent or another in most of the formerly Eastern bloc countries.
The second reason is less rosy. Big outsourcing firms, which make up at least a plurality of the programming market, have little need for experts. Their hiring and retention practices greatly emphasize cheap junior hires, whom they don't want to retain past some point. They will usually have a handful of seniors around for the more advanced contracts, but they don't have any reason to keep around a workforce that gains in experience. This is mostly greedy but also partly rational - unlike a traditional business where you get to accumulate valuable context as you gain experience, in outsourcing you will rarely spend more than a few years on the same project, so the advantage of having been around the company for years and years is much less.
Basically everyone that studied something like computer science in the 90s were electrical engineers and the computer stuff was barebones, it was more hardware. Software development like we know it wasn't a thing back then so people started late compared to the west.
I have a dev in his 40s and a sysadmin in his 50s as co-workers but that's rare because of the things you mentioned. With that much experience, high demand and low competition at that level they're going to have cushy jobs that they want to have and won't be sitting at crappy outsource shops.