Second axis, thicks drawn also in the first axis

An alternative using the "Y+" option (no frames or extra axes needed):

from ROOT import TCanvas, TGraph, TPad

name_file="p.txt"

# create first graph
gr = TGraph( name_file ,"%lg %lg" )
gr.SetLineColor(2)
gr.SetMarkerStyle(8)
gr.SetMarkerColor(2)

# create second graph
gr2 = TGraph( name_file ,"%lg %*s %lg" )
gr2.SetLineColor(3)
gr2.SetMarkerStyle(21)
gr2.SetMarkerColor(3)

c1 = TCanvas("c1","c1",600,600)
c1.cd()
gr.Draw("ALP")

overlay = TPad("overlay","overlay",0,0,1,1)
overlay.SetFrameFillStyle(4000) #Remove pad fill to see what's underneath
overlay.Draw()
overlay.cd()
gr2.Draw("ALPY+") #Draw Y axis on right side

c1.Update()
c1.SaveAs("P.png")