Suppose I am flying BOS-LGA-EWR-SFO with a 5 hour layover between LGA and EWR-SFO. Suppose BOS-LGA was 3 hours late (because of Weather or ATC or Mechanical Failure) and I don't make it to EWR on time. Would the airline rebook me (for free)?
Yes, particularly in your circumstance where the airline can see it occurred because of a delayed inbound flight. In that condition the delay has encroached into the "minimum connect time" between LGA and EWR (which is three hours).
If you were involved in a delay between LGA and EWR I would also expect to be re-accommodated. However this is a bit more difficult to assert and prove.
(All of this relies on these flights being on a single ticket---that is, bought at the same time from one seller.)
By the way, you can write "LGA-EWR" as "LGA//EWR" to indicate that you are not flying between LGA and EWR but using alternative transportation.