PWM noise on the 5V rail

Inductors will help but basically you need more capacitance across your supplies. Start of with 100uF and add more if you still have a problem. Bothe the 24V supply and the 5V supply need extra capacitance on them.