My rule for counseling is to select the branch and then check the institution. In your case, the branch is already clear. To compare any two IITs, especially the same generation of IITs, is quite difficult.
However, I will try my best to assist you with this choice. According to me, UG is the time for you to explore your passions and interests. After your graduation, it is very much possible that you end up choosing a career other than engineering. Therefore, you must get the space for self-exploration at this stage. IIT Gandhinagar has a very flexible curriculum that allows this kind of space. Also, IIT Gandhinagar has the biggest endowment among the second-generation IITs. It offers 30-40% of the batch opportunities to pursue foreign internships, and it has a very strong research culture.
IIT Gandhinagar has a locational advantage over IIT Ropar. Gandhinagar is the capital of Gujarat. The IIT campus is located in the vicinity of CM residence, Vidhan Sabha, the ambitious GIFT City project, and top institutes such as DAIICT, NIFT, and many others.
Placement-wise, for 2023, the B.Tech CSE branch at IIT Gandhinagar recorded 94.4% placement, with a median salary of INR 25.06 LPA and an average salary of INR 29.29 LPA. Top companies like Nutanix, Goldman Sachs, ITC, Barclays, etc. have been visiting the campus for recruitment for a long time. IIT Gandhinagar alumni have been working in top firms across the globe. To name a few- Mckinsey, Microsoft in the US, Amazon, Apple, BCG, ATK, Bain, Google, Facebook, Goldman Sachs, ITC, PnG, and Morgan Stanley.
I would suggest you also talk to the alumni from IIT Ropar to get a clearer picture. As far as my opinion is concerned, I would suggest you choose IIT Gandhinagar for your CSE. You can attend the JEE open house which is organized by IIT Gandhinagar in s Delhi, Gandhinagar, and Mumbai. Here you can meet the faculty, alumni, and students of this institution.