AFAIK, there is no airside transfer in JFK. Everyone has to pass through US INS regardless of final destination. However, since CX flight arrives very late at BA terminal, the immigration should only take a few minutes. On somedays, I could hit taxi stand within 10 minutes. There is no exit immigration in JFK. I think you would need to go through INS, go upstairs for security check, then departure area. The entire process could be done in 10 minutes assuming no checked lugguage. The INS officer in YVR may be curious to know why you just passed JFK a few hours ago though.