void loop()
{
read_serial();
}
The loop() function is called in an endless loop. Having that function do nothing but call one other function is a waste of time.
NewSoftSerial rfid(7, 8);
NewSoftSerial xbee(10, 9);
Only one instance can be listening at a time.
if(flag = 1){
When you assign a value to a variable, the result is the value assigned. So, this might as well be:
flag = 1;
if(1) {
which is likely not what you intended.
Now it verifies but doesn't work.
It does something. You want it to do something. Clearly those two somethings are not the same thing. But, you've given us no clue what either of those things is.