Electron localization in metallic quantum wells: Pb versus In on Si(111)