Incorporating ramming damage would be problematic from a balance/meta perspective, but what if instead of damage, a shock mechanic is used instead?
Shock would work on the basis of causing 'stun' to parts and crew. Reactors would shut down into a failsafe mode, requiring some time to restart (larger reactors takes longer time to restart), factories would jam and require crew to clear and fix the jam (more crew = faster reset), and crew could be momentarily stunned and take time to recover (crew in bunks/quarters could be immune to stun). Weapons, shields, thrusters and other parts could continue to function as per normal (crew are strapped in place when manning equipment), except that reactors/factories are temporarily offline, and they would have to rely on storages for resupply. This effect would apply across the entirety of both ships.
Shock would apply based on the momentum divided by the mass of the ship, and would have to reach certain limits before different effects would be applied, so much small ships ramming a large ship would result in shock applied to the smaller ship, while the larger ship would not be affected or have less effect on it.
Example: A 2000 ton ship (A) is rammed by a 500 ton ship (😎 with a relative velocity of 200 units.
Shock applied on Ship A: 500t x 200 / 2000t = 50
Shock applied on Ship B: 2000t x 200 / 500t = 800
Crew stun requirements: 0.1s stun per 10 shock value, max of 3s
Reactor shutdown requirement: 300 shock
Reactor restart duration: 3/6/9s (S/M/L) after a crew enters the reactor (ie, push the restart button)
Factory shutdown requirement: 500 shock
Factory restart requirements: 4 crew-seconds (ie, 4 crew to clear the jam in 1s)
Effects on Ship A: Crew is stunned for (50 / 10) x 0.1 = 0.5s
Effects on Ship B: Crew is stunned for (800 / 10) x 0.1 = 8s (reduced to 3s max duration)
Reactors shutdown for 3s (crew stun) + 3s (small reactor) + travel time (if any)
Factories shutdown for 3s (crew stun) + [4 / crew in factory]s + travel time (if any)
As it can be seen from the example, the lighter ship suffers more (which is to be expected), and it would be difficult for a much smaller ship to have an impact on a much larger ship, while keeping ramming as a tactical mechanic. This also makes storages much more useful for buffering the downtime while the reactors/factories restart production.
Of course the numbers/formula can be adjusted and tweaked for game balance, this just serves as an example of how ramming/shock mechanics could work.