Given answer is correct!
Explanation:
S gives A, if we put 'epsilon' instead of A in rule-1 then we get 'a' from S and same explanation for getting 'b'. Now, for 'epsilon' S should gives to 'epsilon' directly!
Hope you get it(just think one string in mind and pass through it)