I think the odds of Vice President Pence invoking the 25th amendment are somewhat lower than the odds of the Knicks winning the NBA championship this year, but the the highly theoretical prospect raises a tidy legal question.
Recall that Section 4 of the 25th Amendment states that,
Whenever the Vice President and a majority of either the principal officers of the executive departments or of such other body as Congress may by law provide, transmit to the President pro tempore of the Senate and the Speaker of the House of Representatives their written declaration that the President is unable to discharge the powers and duties of his office, the Vice President shall immediately assume the powers and duties of the office as Acting President.
Thereafter, when the President transmits to the President pro tempore of the Senate and the Speaker of the House of Representatives his written declaration that no inability exists, he shall resume the powers and duties of his office unless the Vice President and a majority of either the principal officers of the executive department or of such other body as Congress may by law provide, transmit within four days to the President pro tempore of the Senate and the Speaker of the House of Representatives their written declaration that the President is unable to discharge the powers and duties of his office. Thereupon Congress shall decide the issue, assembling within forty–eight hours for that purpose if not in session. If the Congress within twenty–one days after receipt of the latter written declaration, or, if Congress is not in session, within twenty–one days after Congress is required to assemble, determines by two-thirds vote of both Houses that the President is unable to discharge the powers and duties of his office, the Vice President shall continue to discharge the same as Acting President; otherwise, the President shall resume the powers and duties of his office.
No one imagined we’d have so many acting Cabinet Secretaries as we do now. I think we are up to five out of fifteen at present (counting only true heads of major executive departments and not other ‘Cabinet-level’ appointees), with more perhaps on the way
So the legal mind starts to wonder: Do Acting Secretaries get to vote under the 25th Amendment? And if not, does the size of the majority required (eight if all count) go down?
The short answer is that it’s most likely that Acting Secretaries get to vote:
The Congressional Research Service did a report, Thomas H. Neale, CRS, Presidential Disability Under the Twenty-Fifth Amendment: Constitutional Provisions and Perspectives for Congress (Updated November 5, 2018) which tells you provably much more than you want to know about the history and mechanics of the 25th. On page 11 it says,
Respecting details of the Cabinet’s participation, the House Judiciary Committee’s 1965 report on the proposed amendment stated that in the event of a vacancy in any of the Cabinet offices, “the acting head would be authorized to participate in a presidential disability determination,” while [John D,] Feerick [a leading scholar of presidential disability and succession] notes that the amendment’s supporters asserted that recess appointees to Cabinet offices would also be eligible to participate in a Section 4 deliberation.
This generally accords with a 1985 memo from the Office of Legal Counsel (the agency in the Justice Department charged with opining on such issues):
We believe that the “principal officers of the executive departments” for the purposes of the Twenty-Fifth Amendment are the heads of the departments listed in 5 U.S.C. § 101, presently the Secretary of State, Secretary of the Treasury, Secretary of Defense, Attorney General, Secretary of the Interior, Secretary of Agriculture, Secretary of Commerce, Secretary of Labor, Secretary of Health and Human Services, Secretary of Housing and Urban Development, Secretary of Transportation, Secretary of Energy, and Secretary of Education. This view is supported by the legislative history of the Amendment. See H.R. Rep. No. 203, 89th Cong., 1st Sess. 3 (1965); 111 Cong. Rec. 7938 (1965) (Rep. Waggoner); id. at 7941 (Rep. Poff); id. at 7944 45 (Rep. Webster); id. at 7952, 7954 (Rep. Gilbert); id. at 3282-83 (Sen. Hart and Sen. Bayh).
At present, this list is identical to the list of statutory Presidential successors under 3 U.S.C. § 19, except that it does not include the Speaker of the House of Representatives or the President pro tempore of the Senate. Furthermore, although the acting heads of departments and recess appointees are not Presidential successors, see 3 U.S.C. § 19(e), the legislative history of the Twenty- Fifth .Amendment suggests that, in the event of a vacancy in office or the absence or disability of a department head, the acting department head, at least at the level of undersecretary, principal deputy, or recess appointee might be entitled to participate in determinations of Presidential disability. See H.R. Rep. No. 203 at 3; 111 Cong. Rec. 15380 (1965) (Sen. Kennedy — acting heads); id. at 3284 (Sen. Hart and Sen. Bayh — interim appointees). But see id. at 3284 (Sen. Bayh — acting heads not entitled to participate). As a practical matter, and in order to avoid any doubt regarding the sufficiency of any given declaration, it would be desirable to obtain the assent of a sufficient number of officials to satisfy any definition of the term “principal officers of the executive departments.”
Of course, if the vote were to happen, and the votes of the Acting Secretaries were needed to make a majority, that would be an issue that Trump could take to court. By the time it could work its way to the Supreme Court, the issue would likely be moot.