All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The ‘Awrah (parts of the body that must be covered in Islam) that a man should cover during the prayer is between the navel and knee.
Therefore, if these trousers cover the ‘Awrah, it is permissible to pray in them otherwise no. Besides, these trousers should be loose enough and not shape the ‘Awrah and they must be thick enough and not transparent in a way that they cover what is underneath them. The evidence for this is that the Prophet said: “Cover your thigh as the thigh is an ‘Awrah”. [Ahmad and At-Tirmithi and Abu Daawood] It is a Saheeh [authentic] Hadeeth.
Finally, if one wears a garment over the trousers that extend to the knees then this is better.
Allah knows best.