No. Enemies can lock on to empty vehicles, and a vehicle going from occupied to empty does not break a lock.
It does, however, make it so that any players on the team with the lock don't see the red diamond that appears on any weapons that can fire on a lock. Not that this is all that useful.