Torrential rain set off by an approaching Tropical Storm Trami has swamped cities in the eastern Philippines, with widespread flooding trapping people in their homes and on roofs.