Spur, branch, mainline etc. are all descriptive, colloquial terms that can vary in usage from railroad to railroad and most are not “official” terms, that is are not defined in a rule book.
Just to add to the list are subdivision, industrial lead, lead and secondary.
From a rules standpoint there is the main track, there are sidings and there is track other than the main track. The main track can be a “main line”, a branch, a subdivision, a secondary, an industrial lead and can be on aa class 1, a terminal line, a regional or a short line.
Normally a spur is a short single ended track, typicall y serving an industry or industries.
The Santa Fe used to run a large number of branch lines in Kansas. Some years ago they sold off the bulk of them to other companies. Santa Fe used to be “THE RAILROAD” that hauled the grain out of Garden City, Kansas, for example. Now “THE RAILROAD” that hauls the wheat out of Garden City is the Garden City Western. Same rails, different ownership. Also the GCW doesn’t go very far. Somewhere down the line they hand off the freight to Santa Fe. Kalmbach published a guide to shortlines in the US. It sells for less than $20.00 I believe. I believe GCW qualifies as a “short line”. On the other hand, a few years ago the former ICG line between St. Louis and Kansas City was operated by the Gateway Western which probably qualified as a regional. One of it’s owners was the Santa Fe. When Santa Fe and BN became BNSF the resulting giant had other ways to get to St. Louis so the Gateway Western was sold to Kansas City Southern. I think it’s still a seperate entity, but you can’t tell that by train watching. Everything I see on the GWW is pretty much KCS. Hope this info is of some help.