Yes, you would lose the granaries, just like if someone captured the pyramids from you. It would be one reason not to sell those granaries (built before you got the pyramids) that aren't costing you any upkeep.
I think it would improve the game by giving you a tougher choice of whether or not to research a certain technology. Most, if not all the obsoleting wonders puts you in a situation where you would like to get a tech, but it makes your wonder obsolete, so there is a trade-off.
Great Library-Education and Universities
Hanging Gardens- Steam Power and railroads
Oracle-Theology and Sistine's
By the time you hit the industrial age, your cities will be maxed out at size 12 and can build a new granary in 1-3 turns anyways. You've gotten the major benefit of boosting your populations from size 1-12 during two whole ages, that you don't need another boost when hospitals come into play. Makes the wonder too powerful. Perhaps there should be another wonder in the industrial age that works like the Pyramids, but is available after the Pyramids expires. This allows the 'free granaries' to possibly go to someone else, and perhaps see a shift in power.
I believe the DyP mod has similar situations.