Since this is essentially the same problem with different numbers, I’d like to bring Gareth’s ingenious approach here too: First,
decrease the amount each person eats by 1, then have 40 people eating, well, nothing.
The amounts become
H=3, S=1, and M=negative .75 plates.
From these, form all combinations that sum up to zero. They are
combo 1: H+4M (5 people)
combo 2: 3S+4M (7 people)
..and that’s it, really. All the other possible combos are combinations of these two.
Adding fives and sevens up, so that there is at least one of each, there is exactly one way to get 40: $1\times 5 + 5 \times 7$.
So, we need exactly 1 combo 1, and 5 of combo 2, which adds up to
1 hindu, 24 muslims and 15 sikhs.
Why does this approach work?
The reason this works is that the "1" in the first spoiler block is not just any random "one", it's magical. To be more specific, it's the exact required amount that every person needs to eat on average. The second spoiler block's values indicate how much choosing each person causes us to deviate from the required average, and the third spoiler block lists every possible (linearly independent) combination where the average is exactly right, that is, the total deviation is zero.
Adding such combinations to one another will, of course, keep the average correct, so you get the correct average in the end, as was seen above. Adding people in any other proportion would cause the average to deviate from the required one, which means that there cannot possibly be a solution we somehow missed by this approach.