Authors should strive to write sentences that is easy to understand. If there is any possibility of misunderstanding, the sentence can be rewritten to disambiguate.
If the intended meaning is "First school was destroyed by earthquake then local government re-built it."
> The local government built the school that had been destroyed by the earthquake.
> The local government rebuilt the school that was destroyed by the earthquake.
If the intended meaning is "The school that was built by local government, was destroyed by the earthquake."
> The school built by local government was destroyed in the earthquake. (I changed "by the earthquake" to be "in the earthquake" to avoid using two "by"s in rapid succession.)