Why can the regenerative brakes of the Oslo Metro only share energy with other trains if they are "nearby"?
Is the resistance in the wires along the track making it not worth it? 


That will be one factor. The article states that each set has 12 x 140 kW motors giving a total of 1680 kW (1.68 MW) for each train set. The system is 750 V DC and, unusually, uses third-rail in some sections and overhead lines in others. At those power levels currents in the order of 2000 A will be involved so line resistance certainly becomes an issue. Line resistance may also be a factor in circuit-breaker operation and trip times and place further constraints on the maximum length of a section.

Another factor to remember is that the power stations (basically transformers / rectifiers / filters and circuit-breakers) will be spread out along the line with sectional isolators between each power station. In this case the current can't flow from one section to the next. I suspect that this is the real reason for the "nearby" constraint.


  Couldn't the energy be fed back into the grid instead?


It could, but it would require inverters to convert DC to AC and these wouldn't be cheap at those power levels and the duty cycle (the amount of regeneration time involved) may not make them worthwhile.



Additional information.


OS MX3000.



  Acceleration in the range 0 to 40 kilometers per hour (0 to 25 mph) is  limited to 1.3 meters per second squared (4.3 ft/s2). In this phase, the fully loaded train uses 5.0 kiloampere.


So, 5000 A max current per train. I can't find any resistance tables for steel rails so I can't provide an estimate of the voltage drop per km.