Function not working on any file other than the main plugin file

I guess you should be using register_activation_hook() with the full path including filename, not just the path:

register_activation_hook( plugin_dir_path(__FILE__) . 'test-plugin.php', 'enable_user_registration' );

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.