Complex sentence: Detachments can be given special names, after famous battles fought by the British army, e.g. Rhine, Gibraltar and Waterloo but are usually called by the name of the town they reside in.
Split into simpler sentences: Detachments can be given special names, after famous battles fought by the British army, e.g. Rhine, Gibraltar and Waterloo. But some detachments are simply called by the name of the town they reside in.