If a resource is in a tile connected to a city building it takes up a spot in the build queue. If it is not next to a city, it does not. Even when it does take up a slot in the build queue it is still built simultaneously with anything listed before it in the build queue, however once the resource becomes the first item in the queue all other items wait for the resource to be constructed.
It's inconsistent. Seems like you mean to have the resources built right away and they're not supposed to be added to the city's build queue at all.