There’s no reason aside from revenue that freeway speeds decrease just because you cross a city line. If traffic it too heavy, the laws of physics will adjust the speeds down just fine on their own.
Also - I hate when a rural road drops from 55 to 25 instantly just because you entered the village limits of a podunk town nobody lives in anyway.
And don’t forget the actual town is probably no where near the freeway. We have Casa Grande for that, where the people live is about 5 minutes from I-10 via their connecting road, but they have a chunk of 10 “in” their city limits for the ticket revenue.
You already made the connection: revenue enhancement. The drastic speed limit change is your classic speedtrap. Look for the town to have a 24h/7d magistrate to collect the cash from travelers.