Elderly and vulnerable residents were among those moved out of their homes when a fire broke out at an electrical substation in west London.