You can ask to have the RUC applied only to the JFK to SFO segment. On a recent MSP-ATL-SAN itinerary I asked to be on the wait list (there was no immediate availability when I purchased the ticket) for the RUC upgrade only on the ATL-SAN segment rather than risk wasting it on the short segment and not getting upgraded on the long one. As it turned out, I got a medallion upgrade for MSP-ATL and then got the only gate upgrade with the RUC for ATL-SAN.