You can check the mosfet modules individually, by only connecting the 24v and a 5v on the gate of the mosfet module.
Why are you using a Mega, instead of a cheaper Nano?
Just write simple program to switch the digital outputs on one at a time or all on, Then try the analogue inputs.
Your circuit looks fine - and should not burn out at all - it seems like you damaged something whilst assembling the circuit.