How can I find the duplicate items inside L1 get their index, and use that index to aquire the corresponding item in L2. Then get the value of these items from L2 and sum them up.
After that remove the duplicates from L1 or create another list (say L1a) without duplicates. Also create another list (L2a) where the items with indices equal to the duplicates from L1 are replaced with their sum.

Practical case:
I have a number of lines, such that all lines are in XY plane and parallel to Y axis.
Ergo, they all have constant X coordinate, but some lines just like the values in L1 overlap but have different lengths.

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino as R
line_guids = rs.GetObjects('select lines')
# get line geometry
lines = []
for lg in line_guids:
lines.append(rs.coerceline(lg))
# dict to hold list of lines keyed on x coordinate
line_lists = {}
# populate the dict
for line in lines:
if line.FromX not in line_lists: # should probably test x to some window
line_lists[line.FromX] = [line]
else:
line_lists[line.FromX].append(line)
# loop through the line_lists and do calcs
for x_start, line_list in line_lists.items():
sum = 0
count = len(line_list)
for line in line_list:
sum += line.Length
print('x coord of {} has {} lines with summed length of {}'.format(x_start, count, sum))

Output:

x coord of 0.0 has 3 lines with summed length of 20.9950916265
x coord of -6.61721090246 has 1 lines with summed length of 5.94563031763
x coord of -3.77186291026 has 3 lines with summed length of 14.1364263773

Input:

Should probably think about the x coordinate key precision though. Also it doesn’t use list indices, if that is a requirement.