The red coating on them had dissolved but a lot of the medicine had not dissolved.
Well the coating dissolved as expected then, that's good. The medications do include a lot of inactive, filler ingredients that we can see within our stool. That's normal and okay. I've seen white, chalk-colored powder clumps within my stool. With asacol hd 800MG, that's normal, and I'd see a whole capsule with split on the side and some of the white inside left (normal). With lialda/mezavant 1200MG, all I would see is orange flakes and no pills. Your formulations within India are likely different than what I can get within the USA, so I cannot say whether with your brand that's an okay result or not. I'd ask your pharmacist.
You can try another brand of mesalamine. Alternatively, you can ask for precursor to mesalamine without the coating: sulfasalazine or balsalazide disodium. Those medications are more complex molecules that gut bacteria break down into mesalamine and a byproduct. Sulfasalazine is also available in a syrup, measure in a spoon and drink. So there are other options available to you, if you fear that the medications are not reaching their target as expected.
I don’t know how to slow down the food transit time , any suggestions
Healing your UC flare is the best way possible. Inflammation causes fast food transit times.