Short answer: yes, with permission. Whether or not you're on an airway isn't really relevant.
The basic regulations on restricted airspace are in 14 CFR 91.133 and they apply to all aircraft on all flights:
(a) No person may operate an aircraft within a restricted area
(designated in part 73) contrary to the restrictions imposed, or
within a prohibited area, unless that person has the permission of the
using or controlling agency, as appropriate
The AIM 3-4-3 also makes it clear that you can enter restricted airspace (my emphasis):
Restricted areas contain airspace identified by an area on the surface
of the earth within which the flight of aircraft, while not wholly
prohibited, is subject to restrictions.
And it has details of how ATC handles IFR traffic:
1. If the restricted area is not active and has been released to the controlling agency (FAA), the ATC facility will allow the aircraft to
operate in the restricted airspace without issuing specific clearance
for it to do so.
2. If the restricted area is active and has not been released to the controlling agency (FAA), the ATC facility will issue a clearance
which will ensure the aircraft avoids the restricted airspace unless
it is on an approved altitude reservation mission or has obtained its
own permission to operate in the airspace and so informs the
controlling facility.
In other words, you can fly through restricted airspace if the controlling agency gives you permission, either directly or via ATC. In the specific case of the Camp Pendleton restricted areas, the Los Angeles sectional says that you should contact LA Center or SoCal TRACON (for R-2503D), and shows that the areas are not active 24 hours per day:
So in theory you can fly through at 3am without asking anyone, but if you're planning a flight that goes through a restricted area you should make sure you get a flight briefing and ask the briefer about that point specifically. And it wouldn't hurt to confirm again in the air before entering, in case the areas 'go hot' suddenly.