Is getting a good grade enough to ask for a letter of recommendation for a grad school application?
The only guarantee is that if you don't ask, you don't get the letter. So ask. 

I'm sure your situation is common in large places and it is good to find ways to "stand out" with at least a few professors as you go along, but that is too late for you now if time is short. 

But ask in person, during office hours, and be prepared to remind the professor of your past association even if it is only a little. If you ask by email it is too easy to just say no, sorry. But if you get turned down in person you might also get some advice about how to proceed (along with the disappointment).