Can a women attend a mixed gym and wear non-fitted pants while working out there?
In principle this is permitted, in particular for an area where men in the gym are not generally Jewish (an area where the majority of inhabitants or of gym attendees are not Jewish). The concern of improper thoughts etc. for men does not apply to non-Jews (see Rivevos Efraim Vol. 5, no. 491).
At the same time it remains proper to dress modestly (as far as possible), and to avoid the male-female interaction that can lead to a certain lowering in standard of tznius.
This depends on specific circumstances, but in general it is certainly preferably to find an all-women gym where this is possible.