Rigid foam is more flammable than glass fiber. (Isocyanurate has better resistance and lower flame spread than polyurethane; alternatively, glass fiber backing is somewhat combustable.) It also melts when heated and can drip during a fire (only a problem on commercial roof decking or within tall building walls). Usually it is also a little more expensive.
The pluses are that it is better R per inch thickness when properly joined and taped, it provides the same insulation value when wet, and it provides less of a burrowing opportunity for rodents.
Glass fiber is going to be more convenient between wooden construction members (properly sized) and will have a snugger fit, and therefore actually perform better than loose-fitting rigid. Unless you can get rigid at a great price, I'd go with the batten.