From the Super Mario Wiki
Metal Blocks are large, metallic blocks that are found in the Paper Mario series.
These blocks typically serve as barriers which block a path to either a new or hidden area. The only way Mario can destroy the blocks and proceed beyond them is by using the Ultra Hammer, which he finds in Chapter 5 during his expedition into Mt. Lavalava. Luigi will be sitting on one after Mario gets an Ultra Hammer.
In Paper Mario: The Thousand-Year Door, a few Metal Blocks can be found in the Riddle Tower. Here, they cannot be destroyed, even with the Ultra Hammer; instead, Mario must solve a puzzle to eliminate them.