The period of Mahabharatha and Pyramids are not the same. Most historians suggest that Mahabharatha would have been compiled between 1400–800 BC. The great pyramids were built around 2500 BC. So your timelines are wrong.
Now, coming to the question why one survived and another did not, there are many factors that would have been at play. This is assuming that there were large palaces during the time of Mahabharatha. We don’t have conclusive evidence pointing to their grandeur except Mahabharatha itself.
The pyramids of Egypt were built in the dry environs of Egypt. Not many corroding/weathering agents are at work except sun and wind. The material used for construction was stone, which is also more durable. The pyramids were not palaces and needn’t be liveable like a palace and hence the use of stone was justified. All this meant the pyramid would survive even till date.
In India, at the time, the major material for construction was wood. Only the base and some pillars were made of stone. Wood allowed greater flexibility in shaping and working them. The remains of a Mauryan Palace that we have obtained must be the carry forward of these wood working traditions. India had not figured out to build the true arch. This meant that a stone palace would not be able to reach much height and even for two three floors, a high roof which tapers to the top would be needed. Wood could overcome all these problems.
The weathering agents at work in Indian subcontinent were much harsher. Wind/Water/Sun/Biological activity everything meant that any structure made here would have to face corroding agents at swifter pace.
Then there was also the availability of stones themselves. The gangetic plain where the Mahabharatha must have happened, doesn’t have huge boulders or stones. To get them from distant lands, you’d have to cross the dense forests and haul it through them. Not a very worthy effort, if you think about it.
Given all these factors,we don’t have many remains from the Mahabharatha era.