No, this is wrong, as you illustrate below. Each pixel in the image has a palette "slot" number (I'm sure there's a better word than "slot", but I can't think of what it might be). That's why the palette files exist -- there is no colour information in the .mat files, as I'm sure you know!
Yes of course, you're right, though I was talking about the process of painting in Photoshop, should have made myself clearer. When you choose a color to paint with, it just finds a color which is most similar from the palette, and then just paints with that. It doesn't care which slot number the color is. If you've got two colors with the same value, it's able to use just one of them (probably the one with the lower index number), which makes the other one obsolete.
Indexed image formats such as Indexed PNG, BMP, or TGA all use a number of the palette to depict a pixel. This means that pixel will use color from the palette number it's depicted with.
Unfortunately we're apparently being hamstrung by modern editing software losing capabilities which aren't used very often any more -- or which may seem undesirable today.
That's exactly what happens here, it's Photoshop's own attempt at optimising.
So, it depends which way we want to go I guess.
We can let Photoshop reassign all of the same color to one slot, or do a bit of HEX editing ourselves.
E.G. We take the card.mat for example, each byte after the header with a hexadecimal value of 0x00, will use the first color of the palette (zero based), each byte with the value of 0xFF will use the 256th color, the last one in the palette (also zero based, otherwise 0xFF is 255). So, we could manually select these and assign them different palette numbers. This would be tedious.
I guess I could write a separate piece of software which would let us load an image from the MAT, select pixels from it with E.G. something like the lasso selector, and then tell it which slot to use.
Or just find either a Photoshop plugin that does this, or a better suited alternative than Photoshop (if we can't achieve this within PS), which I think would be the least complicated solution
EDIT: I also saw that the earliest color used in card.mat is the one with the number 0x08, which is the 9th color from the palette. The previous ones (except for 0x00, which is used in transparent parts) are not used here. Perhaps they're used in one of the other mats.