Well the grades are the auction grades or rating. When a car is auctioned in japan it is given a grade out of five according to is condition. eg 4.5/5 means that the car is as good as new and it is virtually the highest grade that a redcond. car can get.
And for X and G which are for japanese corolla are just like XLI or GLi in pakistan. Corolla X is the standard model like XLi (i am not sure but maybe Xli has been derived from X) and corolla G is a better model with wooden texture etc.
This is the best explanation i have and i am quite sure about the both of them.