The California Appeals Court overturned a lawsuit on Tuesday that would have expanded the oil refinery on Rosedale Highway and would have brought more crude oil trains through Bakersfield.