ATOMS: ALMA Three-millimeter Observations of Massive Star-forming regions - XI. From inflow to infall in hub-filament systems