Correct MySQL DB Query and processing
Change SQL Query may help you in someway, like this,

SELECT reg_id, tra_type, GROUP_CONCAT(pro_id SEPARATOR ',') AS pro_ids 
FROM exp 
WHERE pro_id in ($implode_mas)
AND tra_type = '1'
GROUP BY reg_id;


Result will be like this

reg_id    tra_type    pro_ids
1         1           2,6,10
4         1           10


Then you can split it to array