From the Super Mario Wiki
“We go DOWN!”
The Thwomp Elevator is a Thwomp character that appears in Mario & Luigi: Partners in Time. It is shaped much like the Thwomps in Super Mario 64, except it is gray rather than blue. Its purpose in the game in to help the Mario Bros. and their baby selves travel deeper into Thwomp Volcano, but it gets stuck several times and cannot progress any further until the block below it has its corresponding switch is hit. Eventually, the Thwomp Elevator is caught in a hole at the bottom area of the volcano and cannot move. After the brothers defeat Bowser and Baby Bowser, the Thwomp Elevator is launched upward with the two on top of it, Bowser is knocked off by a Shroob UFO into a Time Hole and leaves his baby self to land on the Shroob Mothership, who is taken by it it along with the Mario brothers and the "princess". If the player returns to Thwomp Volcano afterward, the Thwomp Elevator is nowhere to be seen, and the blue pipes are required to explore the lower levels of the volcano, although the bottom level cannot be accessed.