The trick is to use shape builder tool (Shift+M). Shape builder allows you to eliminate lines without expanding something that pathfinder is totally unable to do. Do this:
- Draw mask
- Make your lines.
- Duplicate the lines (to different layer perhaps)
- (Expand duplicate if you used blend tool)
- Select duplicate lines and mask shape, then alt drag a line cutting the outer lines. Apply the remaining lines with a thicker stroke.
Image 1: Time lapse of sequence (mask was drawn after step 4)
Image 2: result with round caps. Time 2 minutes. Now I must sleep.
Now since the ends are lines you can define custom line ends for what kind of transition you want. One can go quite wild with the implementation since it is relatively fast to do. So even complex shapes are viable.
Image 3: A more elaborate effect for fun.