The pronunciation of ath as /ɑːθ/ in certain British accents applies mainly to monosyllabic words. (There's also /ɑːðə(r)/ in the disyllables lather, rather.) Polysyllabic words like pathogen, Catherine, cathode have /æ/. Although maths is one syllable, it is short for the polysyllabic word mathematics /ˌmæθəˈmætɪks/, and so is pronounced with the same vowel sound in the first syllable.
Similarly, according to the Oxford English Dictionary, staph which is short for staphylococcus is pronounced only as /stæf/, unlike staff which can be pronounced as /stɑːf/.
So I would say the general rule is that /æ/ does not change to /ɑː/ in words that are short forms of longer words with /æ/. There is at least one word that could be considered an exception: graph, which the OED says was "Originally an abbreviation of graphic formula", and which can be pronounced as /grɑːf/. But I think that in modern times, people don't think of graph as short for anything, so I would argue that it is not a genuine exception.