Super Mario Galaxy
Astro Goombas appear in Battlerock Galaxy, Bowser's Dark Matter Plant and Dreadnought Galaxy. To defeat them, all you have to do is use Mario's Star Spin and flip it over, then they can be killed with Stomp or Ground Pound.
Super Mario Galaxy 2
Astro Goombas are very slightly different in appearance to the ones in the first game, in that in Super Mario Galaxy 2, their eyes are larger and more bright. They only appear in Bowser Jr.'s Fiery Flotilla.