This is very strange. Had a look at all the options on brfares.com and I see that Dunbar to Edinburgh off peak TPE only single fares are cheaper than the shorter journey from East Linton, despite both fares being fixed by TPE. I presume that's what you're referring to.
There's a few possible reasons. It could be that the fares are being set competitively and TPE are genuinely having to compete for the Dunbar traffic, whereas they control a larger proportion of the trains from East Linton. Alternatively it could be set on the basis that TPE want to cover more of their costs from doing the East Linton stop and need to do it from fewer passengers than they get at Dunbar.
The fact that the longer journey is cheaper won't bother them greatly, since most of the customers are coming from Dunbar anyway, and most of the East Linton customers won't figure out that they could be travelling cheaper.