Yep sure is - using xfa.layout.pageSpan
Place the following in the layout:ready event of the fields (listed below) in each of the Master pages
form.FirstSubforminMP2 refers to the first Subform which appears on Master Page 2
MP 1:
currentPageNum:
this.rawValue = xfa.layout.page(this);
sectionPageCount:
this.rawValue = (xfa.layout.pageCount() - xfa.layout.pageSpan(form.FirstSubforminMP2));
MP2:
currentPageNum:
this.rawValue = xfa.layout.page(this) - (xfa.layout.pageCount() - xfa.layout.pageSpan(form.FirstSubforminMP2));
sectionPageCount:
this.rawValue = xfa.layout.pageSpan(form.FirstSubforminMP2);