I think Sasuke knows he's being used, and is formulating a plan to get what he wants and betraying Madara at the very end.