It's a case of what each interface metric is set to. If the OS's are XP, the metrics will be set automatically. The interface that has the lowest metric is assumed to be superior and is tried first. I am not sure if the second interface will even be tried should the first one fail.
I presume that the LAN interface (with no internet access) has the lower metric, whether by automatic assignment or manually. Since the LAN has no internet access, it does not have a router/default gateway which will attempt to route the packets.
You have a bunch of different options. You could just turn both networks into one network and simply filter out the PC's that you don't want to access the internet. You could keep the two networks and mess around with the metric settings of the interfaces until you get your desired results, or you could do what I did and write a program to automatically calculate the appropriate interface and make a temporary adjustment to the routing table of the PC.
To access certain devices on our office LAN requires me to connect to our VPN. When I login to the VPN I am assigned an IP Address via the DHCP server on our LAN. This provides me with an IP address on the same subnet as all the machines on the office LAN. The office LAN is connceted to a router, which is connected to an additional logical subnet. The devices that I need to acccess are located on this additional subnet.
The office LAN is 192.168.1.0/24
The additional subnet is 192.168.0.0/24
Since my VPN settings are configured such that I am NOT set to use the default gateway on the remote network, I have to manually adjust my routing table in order to each the 192.168.0.0/24 network.
My program runs the ipconfig /all command and re-directs the output of that command to a flat text file. My program parses the text file and locates the IP address that was assigned to me when I connected to the VPN. It then takes that IP address and adds an entry to the routing table that looks something like:
route 192.168.0.0 255.255.255.0 <ip from VPN> <ip from VPN>.
When I try to access a device on the 192.168.0.0/24 network, my routing table is queried and it instructs my computer to send the packet out the interface which is connected to the VPN. This packet is then seen by the router on my network and is forwarded appropriately.