Good question! The short answer is:
1) It is likely that the Philistines out of respect, fear, or pragmatism carried the ark the "proper" way.
2) Num 4:15 does not say that any Gentile touching the ark will die.
3) It is very possible that they did, in fact, die.
Long answer (read: loosely organized thoughts):
1) It is likely that the Philistines out of respect, fear, or pragmatism carried the ark the "proper" way.
1.1) Whereas the Israelites regarded the ark as a magic trinket to imbue luck, the Philistines realized that they ought to fear the God it represented:
Let us (Israel) bring the ark of the covenant of the Lord from Shiloh to us, that when it comes among us it may save us from the hand of our enemies. (1Ki 4:3)
Woe to us (Philistines)! Who will deliver us from the hand of these mighty gods? These are the gods who struck the Egyptians with all the plagues in the wilderness. (1Ki 4:8)
The Philistines brought the ark to a major temple, which also demonstrates their respect for it. They would likely have done their best to treat it according to what they knew of its religious rites. Consider also how they treated the ark afterwards, sending it away with gold.
1.2) The Israelites, seeing that they were being beaten, would doubtless have tried to save the ark, thus the Philistines would have seen how they carried it. Doubtless, when they captured the ark, the poles for carrying the ark were still in it. Either way, if they wanted information about how to carry the ark they would simply have to ask any injured Jew on the battlefield.
1.3) The ark was heavy and would have been impractical to carry. It was basically an exremely heavy box with holes to put poles through to carry it. Anyone who has ever carried anything would naturally carry it by its poles. The description is found in Ex 37:1-5, but any google image search will yield decent images. If any did touch it, it seems likely that they touched it after it had arrived at its destination and not as it was being transported.
2) Num 4:15 does not say that any Gentile touching the ark will die.
2.1) The law in Numbers 4:15 is written to Jews, not Gentiles. It says:
The sons of Kohath shall come to bear it: but they shall not touch any holy thing, lest they die.
It is the sons of Kohath specifically that this law is for. To use another example, the law demands that anyone sacrificing an animal to anyone but God should die - this is not a death sentence to every Gentile outside of Israel, but to Jews (Ex 22:20).
2.2) The Hebrew of Num 4:15 translated "lest they die" is a single word and can be understood as a warning, "because in that case you might die," or as a future certainty, "because in that case you will die." Though I do think the latter is more likely.
3) It is very possible that they did, in fact, die. Num 4:15, if it does speak of definite death, does not promise immediate death. The case of Uzzah cannot necessarily be generalized. If any Philistine touched the ark they may well have died without the text telling us (because that's not the point of the text). Though God did kill many because Philistines because of the ark, and if anyone touched it they may well have been among them:
They have brought the ark of the God of Israel to us, to kill us and our people! (1Sam 5:10)
Conclusion: It is possible to interpret the threat of death in Num 4:15 as a possibility, not a certainty, and either way it does not apply to non-Israelites. Furthermore, it seems likely that the Philistines out of both pragmatism and reverence handled the ark by its proper handles, at least until it arrived at its destination. If any did touch it, they may well have died in the ensuing plague, but as Num 4:15 is written to Jews we cannot assume the certainty of death for Gentiles touching it.