Just use the below code instead of <af:trainbuttonbar> in your page to achieve the same navigation effect along with the properties you require from the commandButton.
<af:commandButton id="back" text="Back" action="#{controllerContext.currentViewPort.taskFlowContext.trainModel.getPrevious}" immediate="true"/> <af:commandButton id="next" text="Next" action="#{controllerContext.currentViewPort.taskFlowContext.trainModel.getNext}" immediate="true"/>
Here, we're actually getting trainModel from trainFlowContext and navigating back and forth using 'getPrevious' and 'getNext' methods. That's it! Enjoy :) !

