I think barring the discovery of a male relative that has a closer blood relationship w/Robert (remember that Matthew is only his third cousin twice removed), Matthew Jr. would become the new Earl of Grantham upon Robert's death and he most likely would inherit all the assets/wealth that comes with the title, unless Robert survives beyond 1925 and changes the will in Mary (or anyone else's) favor.
However, it would be interesting to see if Fellowes will write a plot that will complicate this scenario in S4. If he introduces a new male heir that has a closer blood ties with Robert than Matthew, that would've set up a new feud within the family, as this new heir would've become the new Earl of Grantham instead of Matthew Jr. The British law of primogeniture dictates that in the event the primary family branch of the titled noble dies out because no male heir within that branch can be found, the title would've gone a heir with first cousin relationship with the last incumbent nobleman. If there is no eligible male heir found, then it would've gone to a second cousin, etc. If no eligible male heir remains, then the title become extinct and it would've "reverted back to the crown," and the King/Queen could've let the title to remain extinct or to grant it to another person, who does not necessarily belong to the same family who've hold the extinct title in the past. Because the title is inherited strictly through male line, Mary and her son could still lose out if a male heir with a closer blood ties to Robert than Matthew is found, as the primary thing that determines who gets the title is which one of the heirs have a more direct relationship to Robert, Matthew or the new guy.
If Fellowes decided, say, to make "Patrick" from S2 reappears in S4, that would've set up a new fight within the family, as Patrick was a descendant of Robert's first cousin, thus he'll be able to inherit the title as he has closer blood ties to Robert compared to Matthew. I assume if this happens there would be a big legal fight to determine whether "Patrick" is actually who he is, most likely initiated by Mary to protect her son's claim as the heir to the Grantham earldom and its fortune. For the record I think S2 "Patrick" was an imposter, but who could've proven it in the 1920s, a time where neither blood nor DNA testing exists to prove whether one is actually a blood relative or not . Alternatively, a male relative that we don't know yet could've show up in Downton's door and make a claim to the earldom, and cause the same legal fight to happen.
I could see this scenario happening and it certainly will introduce new drama into Downton that resembles the drama over the Downton entail in S1 (until Matthew is found). However, I have no idea if Fellowes will actually write it, as IMO it would've make Downton to become more soap-operaish than it is now .