Cheap dining in Union Square
Not in Union Square but a quick street car ride to Church street is Home restaurant. They have a 3 course early bird from 5 to 6.
Another option closer to Union Square is Cafe Claude on Claude Lane. If you have a lighter appetite it can be quite reasonable. I usually have the onion soup and a salad for around $15 (plus wine of course)
How much are you thinking for a main course?
Cheap (assuming $10-15 per main course) in Union Square means ethnic... King of Thai Noodle on O'Farrell behind Macy's, Ar Roi Thai on Post, etc. Or Chinatown.
There is an ok Greek place on O'Farrell called Santorini, and a middle Eastern place that is supposed to be good on Sutter called Persimmon.
For Indian on a Sunday, there's Naan n Curry on O'Farrell.
However, none of these are nice, sit-down places (although some do offer table service). Those types of places start at around $15-20 for a main course, which is moderate for the area. Anjou is in this price range, but is closed on Sundays.
Anjou is quite good, but I do not think it could be called a cheap dining option!
You might head west up Post Street a few blocks. There are several Asian restaurants (Thai, Indonesian, Japanese, etc.) in the 600 & 700 blocks of Post Street, on both sides of the street, that are worth a look and are reasonably priced. Pearls Burgers (in the 700 block of Post) is a bare-bones place that puts out a very nice hamburger.