Napoleonic French gendarmes wore uniforms that had changed very little since 1778. The details were set by the 1798 regulations, which specified yellow-buff ('chamois') breeches worn with black gaiters for full dress and dark blue trousers for undress, which also doubled as campaign dress. Dark blue is therefore the correct regulation colour for the overalls.
That said, supply problems sometimes forced local commanders to make do with whatever substitutes they could get their hands on. Along with shoes, trousers usually were the first item of clothing to wear out during periods of extended campaigning. If existing stocks of regulation dark blue trousers were not sufficient to replace the worn out items, new pairs were quickly made from locally available material. Brown was probably the most common colour for non-regulation trousers given that brown cloth was widely used and readily available in Spain.
And just to be pedantic about it, these guys were known as the
Gendarmerie d'Espagne, not the
gendarmes espagnols (which would suggest they were themselves Spanish).