A train is anything that the operating department (by whatever name) decides to call a train.
What is the front of a train, the back of a train and where a caboose is required to be is also determined by the operating department of the railroad. This may change from era to era and, to a much lesser extent, by location.
While it is true that the rear of a train that is required to have a caboose (as above) is the last vehicle and that will be carrying the marker(s)/flag/eot NORMAL practice when a caboose is involved is for it to be the last car - for all the reasons I've stated above.
When the ops dept is defining trains, or a movement as a train it can include On-Track-Machines as trains or not. Just to make life easy they are sometimes classed as a train in their own right and sometimes the same machine(s) aren't classed as trains. If you have the Rule Book you might figure it out.
Even a humble inspection car can be designated as a train.
Exactly the same thing applies when determining whether a very long track run under a bridge is a bridge or a tunnel. If the engineers say it's a tunnel, it's a tunnel... if they say it's a bridge then it's a bridge.
Something to bear in mind is that if you get right out in the wilds and no-one will be looking the working that goes on isn't necessarily "approved". usually "variations" will fall within "grey" areas that can be talked away so long as nothing serious goes wrong. Most of the time nobody will take any notice so long as the job gets done safely. The problem is always to keep things in the "grey area" within bounds and to not start to assume and get into sloppy practices. As in almost any industry people start to assume. "Local Practices" that "everyone knows about" are a constant source of stupid, avoidable and sometimes fatal incidents. Usually things stretch to a limit until people get pulled back in line. The bad things happen when what happens has gone way over the line and someone gets maimed or killed.
I don't think that there is a human on the planet that will not take some sort of short cut. One thing is to be aware that one is taking additional risks whenever one does it...another is to make sure that rookies are taught best practice and... when they've learnt it... make sure that they understand the dangers of the short cuts. Big problems occur when they get to thinking that the short cuts are normal correct procedure.
A lot of the training/mentoring I do is scaring the **** out of rookies with what can go wrong. then i tell them the right way to do the job. I find that most times this is effective for a very long time.