It seems different states do it differently.
US-395 in California, for example, essentially resets the mile markers at the state line. The junction with CA-70, for example, is "Exit 8," despite the southern segment already having existed for several hundred miles.
Another example would be I-24 in Tennessee. A very short segment actually drops into Georgia, yet it continues to use Tennessee's mile markers, instead of an "Exit 1" or w/e. There is a similar case for NY-17: a short segment in Pennsylvania is maintained by NYDOT.
But is there an actual standard? Say a route had its first 100 miles in a state, then goes into another state for 100 miles, then returns to the first state. Should the first exit be "Exit 2xx?"
I don't think there's any set national standard. It all kinda depends on the policies of the DOT and what makes sense to the motoring public.
For short segments, the example like I-24 in Tennessee actually makes sense. Why potentially put two exit 1's so close to each other, when functionally, the route is still in Tennessee? Keeping the mileposting consistent for the short stretch the route is in Georgia makes more sense given the distance in TN.
Regarding the main question examined through the US 395 in CA example. There's about 83 miles in Nevada between the two California segments, and the southern segment doesn't have much, if any, expressway or freeway mileage between Lee Vining and the NV/CA state line (another 70 miles). So to continue any California numbering from the southern segment would be rather silly as it's at least 150 miles. The CA 70 junction is the only exit on the northern segment, as it drops down to two lanes right after the exit, so it really doesn't matter what number they used there. But since there has been such a distance, it makes sense to restart the numbering as the route returns to the state.
I'm not even sure that it's consistent within states. US-212 in Wyoming, for instance, is mileposted separately on each end of the state. Wyomings 89 and 230, on the other hand, uses mileposts as if Idaho 61, Utah 30, Utah 16 and Colorado 127 and 125 were a part of the route. In the latter cases, the route is one functional corridor (which is why US-89 in Wyoming uses an extension of WYO 89's mileposts), whereas it's unlikely that people on US-212 out of Yellowstone will stay on US-212 all the way to the northeast corner of Wyoming.
Actually, were I-24 in Georgia is concerned, the mile markers in Georgia reset and are displayed from 1 to 4, but the exit numbers do follow the Tenessee mileage. Once you are back into Tennessee, the mileposts add in the 4 miles of the roadway that is in Georgia but continue the overall mileage from the Kentucky state line.
US 2 in the UP of Michigan has milemarkers that start at the state-line crossing between Hurley, WI, and Ironwood, MI. When the highway leaves MI to run through Florence, WI, the mile markers pick up again on the other side of Iron Mountain using the total mileage from Ironwood. Those markers are not posted in all places or in all cities, but MDOT has counted the mileage through Florence County, WI, in them.
It's also one of the few places in Michigan where a non-freeway has mile-markers.
In New Jersey, Route 440 begins in the Perth Amboy area, goes through Staten Island and comes back into New Jersey through Bayonne and Jersey City.
The route is mileposted as one complete route (regardless of the state line crossings).
ME113 dips into New Hampshire twice. While Maine doesn't post mile markers on non-interstates, a quick look at MDOT's GIS files shows that NH mileage is not counted toward the overall length. The milepost where 113 re-enters Maine is exactly the same as the milepost at the point where it left.
OTOH, NH153 dips into Maine. The Maine segment is actually listed in NHDOT's route inventory as part of Route 153, and it even shows up in their GIS shapefiles. The mileage counts toward the overall length of the route -- milepost 25.318 to 27.281.