The origin of the X-ray afterglows of gamma-ray bursts has regularly been debated. We fit both the fireball-shock and millisecond-magnetar models of gamma-ray bursts to the X-ray data of GRB 130603B and 140903A. We use Bayesian model selection to answer the question of which model best explains the data. This is dependent on the maximum allowed non-rotating neutron star mass $M_{textrm{TOV}}$, which depends solely on the unknown nuclear equation of state. We show that the data for GRB140903A favours the millisecond-magnetar model for all possible equations of state, while the data for GRB130603B favours the millisecond-magnetar model if $M_{textrm{TOV}} gtrsim 2.3 M_{odot}$. If $M_{textrm{TOV}} lesssim 2.3 M_{odot}$, the data for GRB130603B supports the fireball-shock model. We discuss implications of this result in regards to the nuclear equation of state and the prospect of gravitational-wave emission from newly-born millisecond magnetars.