If you override a text frame, which was included on an associated master page, it will be included into the TOC. To do this, you command+shift-click (control+shift+click on PC) the text frame.
It sounds like you are using separate master pages for each section of your document. If that is the case, you could consider a different route using Number & Sections Options, as well as Special Characters.
1. Set up a single master page for your content
2. In lieu of manually entering the title for your section on the master page add a section marker. Type > Insert Special Character > Markers > Section Marker. On the master page, it will display as the word “Section”. Create a specific paragraph style for this text frame.
3. Add additional pages to your document to test.
4. On the page that starts the first section of your document, assign a Section Marker.
4.a Right-click the page in the Pages Palette and select Numbering & Section Options.
4.b Enter the section’s name in the Section Marker field and select OK
5. Override the master page header text frame by command+shift-click (control+shift+click on PC) on the text frame.
Repeat 4 and 5 for the first page in each section.
What this accomplishes:
1. Subsequent pages within the section will retain the section header, which it pulls from the Numbering & Section Options
2. Section headers will be pulled for the TOC.
Why would you do this versus using separate master pages for each section:
1. You must override a text frame for it to be considered for the TOC. If you override the text frame, changes to this text frame on the master page will not cascade to overridden frames.
What are common issues:
1. Section Markers do not truncate. (i.e., you cannot have multi-line headings using this technique.)