Again, it would depend on your purpose.
If you wish to be able to translate texts, learning Sanskrit first would be a good idea.
If you wish to be able to translate texts that are written in Devanagiri script, learning the devanagari alphabet would be important.
I was told that Pali does not actually have a script/alphabet. It is a language without a script/alphabet.
It seems most commonly conveyed in either a simplified Devanagari script or romanized script.
If you are hoping to translate texts from Pali written in a simplified Devanagari script, perhaps learning the Sanskrit Devanagiri script/alphabet would be a good idea.
Perhaps Bhante #sujato can also share his insights regarding how to best learn these languages if you are interested in translation work.
Your post has inspired me to write my own post asking some questions that I myself still have about how exactly to go about learning these classical languages. Hopefully they prove helpful for you as well: Learn Sanskrit, Prakrit, Pali - Resource Recommendations?