discarding tahmishie kedusha and tahmishie mitzvah (Megilla 26b)
The Gemara specifically states that a sefer torah that is worn out and can no longer be used, should be buried inside an eartherware vessel to preserve it as long as possible. The gemara also says that it should be buried next to a talmid chacham. The Meiri (France, 1249-1310) explains that this means to put the Torah in the actual grave of the talmid chacham; however, Rav Eliezer Walderman (Jerusalem, 1917-2006, Shut Tzitz Eliezer15:8) inferrs from the shulchan aruch that it should only be placed alongside the talmid chacham. Either way, the poskim point out that nowadays our custom is not to bury sifrei torah next to a talmud chacham, like the gemara says, but on the edge of the cemetery in their own section. Perhaps this is because nowadays, we do not want to embarrass anyone or cause a fight by having to decide who is a talmid chacham and who is not.
The poskim also point out that there is no mitzvah to specifically bury a worn out torah. The gemara was only giving one suggestion how to put the torah away in a manner that would prevent it from quickly decomposing or being destroyed. In fact, a torah may be put aside anywhere where it will be safe. Nowadays, many have the custom to leave old, worn out sifrie torah inside the aron kodesh with some marker that they are pasul. Based on this, Rav Moshe Feinstien (OC 2:38) writes that it is permissible to place old sifrei torah that were burned and defaced by the Nazis, inside glass cases for display. He explains that it is permissible to store old sifrei torah anywhere that is in an honorable manner. In this case, it is an honor for the Torah to stand both as a memorial for all of those who died in the Holocaust as well as a symbol that the Klal Yisrael will live on forever, even though the most difficult times, continuing to study and cherish the very same Torah.