Study /
I got accepted into a university in Gliwice, Poland! [38]
You being Syrian it is important that you go to a country where your chances of continuity are as high as possible due to the uncertainty associated with having only Syrian citizenship today, especially if you don't have a permanent right of residence in any other country.
May I ask, what do you intend to study?
I will start with a warning, and rather harshly honest advice. I can almost guarantee that you will have problems at the Polish embassy in Abu Dhabi with your visa application when you apply. The consul over there has a tendency to view applications in an exclusively negative mindset. In the case of a Syrian citizen applying for ANY kind of visa through them, he tends to only assume that because they are Syrian they have no intention to ever leave and therefore automatic rejection. Even if you have millions in your bank accounts in UAE, it won't change how he sees that. And this is irrespective of the fact that as a student you are expected to apply for a residence permit upon arrival and may one day become a contributing member of society.
You are likely to face a similar attitude from more or less all the embassies of the EU countries that used to be under communism (meaning Estonia, Latvia, Lithuania, Poland, Czech, Slovakia, Hungary, Romania, Slovenia, Croatia and Bulgaria).
Therefore, you are better off looking to the West, preferably to an English speaking country (UK, Ireland, Canada, USA etc.) and if not English speaking then go to Germany (although Germany also problematic recently with student visas for Syrian students), Holland or Sweden etc.
If you have absolutely no other choice, then I personally would pick Poland over Latvia.
Polish language is more useful as others have already said, because more people speak it.
Poland is a bigger country with more opportunities and more international companies operating.
Although you might want to try to get into one of the bigger cities (Warsaw, Wroclaw or Krakow for example) instead of Gliwice both for social reasons and for potential career opportunities after graduation.
Regardless of what city in Poland you study in, you need to be prepared financially (meaning income from elsewhere or savings) to pay 100% of your cost of living and studying until you graduate. Assume that you will NOT be able to find meaningful paid work before you graduate.
I cannot comment about comparing laws regarding residence and naturalization of foreigners in the two countries. You need to research this by yourself. I know that Polish laws today are somewhat clear on this and specify several clear paths towards permanent residence and naturalization of foreigners that have resided in Poland for a certain length of time, but I have no idea how it looks like in Latvia.